java.lang.Object
net.i2p.router.message.CloveSet
The unwrapped result of decrypting a GarlicMessage: an array of GarlicCloves plus the outer certificate, message ID, and expiration.
For ElGamal-encrypted messages the certificate/ID/expiration are serialized inside the clove set; for ECIES-encrypted messages they are synthesized with Certificate.NULL_CERT at construction time.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CertificateCertificate accompanying the cloves, if any.private final GarlicClove[]The cloves carried in the set.private final longWhen the set stops being valid, in ms.private final longMessage id of the set.Constructor Summary
ConstructorsConstructorDescriptionCloveSet(GarlicClove[] cloves, Certificate cert, long msgId, long expiration) Create a new CloveSet.Method Summary
Field Details
_cloves
The cloves carried in the set._cert
Certificate accompanying the cloves, if any._msgId
private final long _msgIdMessage id of the set._expiration
private final long _expirationWhen the set stops being valid, in ms.
Constructor Details
CloveSet
Create a new CloveSet.- Parameters:
cloves- non-null, all entries non-nullcert- non-nullmsgId- the message IDexpiration- the expiration time
Method Details
getCloveCount
public int getCloveCount()Get the number of cloves.- Returns:
- the clove count
getClove
Get the clove at the specified index.- Parameters:
index- the zero-based position within the garlic message- Returns:
- the clove at the given index
- Throws:
ArrayIndexOutOfBoundsException- if the index is out of range
getCertificate
Get the certificate.- Returns:
- the certificate that signed this garlic message
getMessageId
public long getMessageId()Get the message ID.- Returns:
- the 64-bit clove message ID
getExpiration
public long getExpiration()Get the expiration.- Returns:
- the expiration time
toString