diff options
Diffstat (limited to 'core/src')
45 files changed, 379 insertions, 188 deletions
diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/Attribute.java b/core/src/main/java/org/bouncycastle/asn1/cms/Attribute.java index 2d31ace5..b3d8fbfb 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/Attribute.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/Attribute.java @@ -11,13 +11,25 @@ import org.bouncycastle.asn1.DERObjectIdentifier; import org.bouncycastle.asn1.DERSequence; /** - * <a href="http://tools.ietf.org/html/rfc5652#page-14">RFC 5652</a> + * <a href="http://tools.ietf.org/html/rfc5652#page-14">RFC 5652</a>: + * Attribute is a pair of OID (as type identifier) + set of values. + * <p> * <pre> * Attribute ::= SEQUENCE { * attrType OBJECT IDENTIFIER, * attrValues SET OF AttributeValue * } + * + * AttributeValue ::= ANY * </pre> + * <p> + * General rule on values is that same AttributeValue must not be included + * multiple times into the set. That is, if the value is a SET OF INTEGERs, + * then having same value repeated is wrong: (1, 1), but different values is OK: (1, 2). + * Normally the AttributeValue syntaxes are more complicated than that. + * <p> + * General rule of Attribute usage is that the {@link Attributes} containers + * must not have multiple Attribute:s with same attrType (OID) there. */ public class Attribute @@ -31,9 +43,9 @@ public class Attribute * <p> * Accepted inputs: * <ul> + * <li> null → null * <li> {@link Attribute} object - * <li> {@link org.bouncycastle.asn1.ASN1Sequence ASN1Sequence} input formats with Attribute structure inside - * <li> null -> null + * <li> {@link org.bouncycastle.asn1.ASN1Sequence#getInstance(java.lang.Object) ASN1Sequence} input formats with Attribute structure inside * </ul> * * @param o the object we want converted. diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/AttributeTable.java b/core/src/main/java/org/bouncycastle/asn1/cms/AttributeTable.java index f114623b..9c61054c 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/AttributeTable.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/AttributeTable.java @@ -11,6 +11,10 @@ import org.bouncycastle.asn1.ASN1Set; import org.bouncycastle.asn1.DERObjectIdentifier; import org.bouncycastle.asn1.DERSet; +/** + * This is helper tool to construct {@link Attributes} sets. + */ + public class AttributeTable { private Hashtable attributes = new Hashtable(); diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/Attributes.java b/core/src/main/java/org/bouncycastle/asn1/cms/Attributes.java index 2aeb3143..99e54d60 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/Attributes.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/Attributes.java @@ -4,10 +4,12 @@ import org.bouncycastle.asn1.ASN1EncodableVector; import org.bouncycastle.asn1.ASN1Object; import org.bouncycastle.asn1.ASN1Primitive; import org.bouncycastle.asn1.ASN1Set; -import org.bouncycastle.asn1.DERSet; +import org.bouncycastle.asn1.DLSet; /** - * <a href="http://tools.ietf.org/html/rfc5652">RFC 5652</a> base type for 5 attribute sets: + * <a href="http://tools.ietf.org/html/rfc5652">RFC 5652</a> defines + * 5 "SET OF Attribute" entities with 5 different names. + * This is common implementation for them all: * <pre> * SignedAttributes ::= SET SIZE (1..MAX) OF Attribute * UnsignedAttributes ::= SET SIZE (1..MAX) OF Attribute @@ -32,7 +34,7 @@ public class Attributes public Attributes(ASN1EncodableVector v) { - attributes = new DERSet(v); // the input vector is in unpredictable order -> must sort. + attributes = new DLSet(v); } /** @@ -40,9 +42,9 @@ public class Attributes * <p> * Accepted inputs: * <ul> + * <li> null → null * <li> {@link Attributes} object * <li> {@link org.bouncycastle.asn1.ASN1Set ASN1Set} input formats with Attributes structure inside - * <li> null -> null * </ul> * * @param o the object we want converted. diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/AuthEnvelopedData.java b/core/src/main/java/org/bouncycastle/asn1/cms/AuthEnvelopedData.java index 8fde6dbf..27bdee84 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/AuthEnvelopedData.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/AuthEnvelopedData.java @@ -18,11 +18,11 @@ import org.bouncycastle.asn1.DERTaggedObject; * <p> * ASN.1: * <pre> - * id-ct-authEnvelopedData OBJECT IDENTIFIER ::= { iso(1) + * id-ct-authEnvelopedData OBJECT IDENTIFIER ::= { iso(1) * member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9) * smime(16) ct(1) 23 } * - * AuthEnvelopedData ::= SEQUENCE { + * AuthEnvelopedData ::= SEQUENCE { * version CMSVersion, * originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL, * recipientInfos RecipientInfos, @@ -147,10 +147,11 @@ public class AuthEnvelopedData } /** - * return an AuthEnvelopedData object from the given object. + * Return an AuthEnvelopedData object from the given object. * <p> * Accepted inputs: * <ul> + * <li> null → null * <li> {@link AuthEnvelopedData} object * <li> {@link ASN1Sequence org.bouncycastle.asn1.ASN1Sequence} input formats with AuthEnvelopedData structure inside * </ul> diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/AuthenticatedData.java b/core/src/main/java/org/bouncycastle/asn1/cms/AuthenticatedData.java index b1fb8806..53958af9 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/AuthenticatedData.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/AuthenticatedData.java @@ -15,8 +15,10 @@ import org.bouncycastle.asn1.DERTaggedObject; import org.bouncycastle.asn1.x509.AlgorithmIdentifier; /** - * <a href="http://tools.ietf.org/html/rfc5652#section-9.1">RFC 5652</a> - * + * <a href="http://tools.ietf.org/html/rfc5652#section-9.1">RFC 5652</a> section 9.1: + * The AuthenticatedData carries {@link AuthAttributes authAttrs} and other data + * which define what really is being signed. + * <p> * <pre> * AuthenticatedData ::= SEQUENCE { * version CMSVersion, @@ -125,7 +127,7 @@ public class AuthenticatedData } /** - * return an AuthenticatedData object from a tagged object. + * Return an AuthenticatedData object from a tagged object. * * @param obj the tagged object holding the object we want. * @param explicit true if the object is meant to be explicitly @@ -141,12 +143,13 @@ public class AuthenticatedData } /** - * return an AuthenticatedData object from the given object. + * Return an AuthenticatedData object from the given object. * <p> * Accepted inputs: * <ul> + * <li> null → null * <li> {@link AuthenticatedData} object - * <li> {@link org.bouncycastle.asn1.ASN1Sequence ASN1Sequence} input formats with AuthenticatedData structure inside + * <li> {@link org.bouncycastle.asn1.ASN1Sequence#getInstance(java.lang.Object) ASN1Sequence} input formats with AuthenticatedData structure inside * </ul> * * @param obj the object we want converted. diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/CompressedData.java b/core/src/main/java/org/bouncycastle/asn1/cms/CompressedData.java index b04c538f..6199b932 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/CompressedData.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/CompressedData.java @@ -46,7 +46,7 @@ public class CompressedData } /** - * return a CompressedData object from a tagged object. + * Return a CompressedData object from a tagged object. * * @param _ato the tagged object holding the object we want. * @param _explicit true if the object is meant to be explicitly @@ -62,13 +62,13 @@ public class CompressedData } /** - * return a CompressedData object from the given object. + * Return a CompressedData object from the given object. * <p> * Accepted inputs: * <ul> + * <li> null → null * <li> {@link CompressedData} object - * <li> {@link org.bouncycastle.asn1.ASN1Sequence ASN1Sequence} input formats with CompressedData structure inside - * <li> null -> null + * <li> {@link org.bouncycastle.asn1.ASN1Sequence#getInstance(java.lang.Object) ASN1Sequence} input formats with CompressedData structure inside * </ul> * * @param obj the object we want converted. diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/CompressedDataParser.java b/core/src/main/java/org/bouncycastle/asn1/cms/CompressedDataParser.java index f38bf0eb..41895ce2 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/CompressedDataParser.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/CompressedDataParser.java @@ -7,7 +7,7 @@ import org.bouncycastle.asn1.ASN1SequenceParser; import org.bouncycastle.asn1.x509.AlgorithmIdentifier; /** - * <a href="http://tools.ietf.org/html/rfc3274">RFC 3274</a>: CMS Compressed Data. + * Parser of <a href="http://tools.ietf.org/html/rfc3274">RFC 3274</a> {@link CompressedData} object. * <p> * <pre> * CompressedData ::= SEQUENCE { diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/ContentInfo.java b/core/src/main/java/org/bouncycastle/asn1/cms/ContentInfo.java index fe05b6b3..4fcd3982 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/ContentInfo.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/ContentInfo.java @@ -40,9 +40,9 @@ public class ContentInfo * <p> * Accepted inputs: * <ul> + * <li> null → null * <li> {@link ContentInfo} object - * <li> {@link org.bouncycastle.asn1.ASN1Sequence ASN1Sequence} input formats with ContentInfo structure inside - * <li> null -> null + * <li> {@link org.bouncycastle.asn1.ASN1Sequence#getInstance(java.lang.Object) ASN1Sequence} input formats with ContentInfo structure inside * </ul> * * @param o the object we want converted. diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/ContentInfoParser.java b/core/src/main/java/org/bouncycastle/asn1/cms/ContentInfoParser.java index b22c0545..19f0ec88 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/ContentInfoParser.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/ContentInfoParser.java @@ -7,8 +7,8 @@ import org.bouncycastle.asn1.ASN1ObjectIdentifier; import org.bouncycastle.asn1.ASN1SequenceParser; import org.bouncycastle.asn1.ASN1TaggedObjectParser; -/* - * <a href="http://tools.ietf.org/html/rfc5652#section-3">RFC 5652</a> ContentInfo object parser. +/** + * <a href="http://tools.ietf.org/html/rfc5652#section-3">RFC 5652</a> {@link ContentInfo} object parser. * * <pre> * ContentInfo ::= SEQUENCE { diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/DigestedData.java b/core/src/main/java/org/bouncycastle/asn1/cms/DigestedData.java index d7efd0ce..ad4d2c87 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/DigestedData.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/DigestedData.java @@ -50,7 +50,7 @@ public class DigestedData } /** - * return a DigestedData object from a tagged object. + * Return a DigestedData object from a tagged object. * * @param _ato the tagged object holding the object we want. * @param _explicit true if the object is meant to be explicitly @@ -66,13 +66,13 @@ public class DigestedData } /** - * return a DigestedData object from the given object. + * Return a DigestedData object from the given object. * <p> * Accepted inputs: * <ul> + * <li> null → null * <li> {@link DigestedData} object - * <li> {@link org.bouncycastle.asn1.ASN1Sequence ASN1Sequence} input formats - * <li> null -> null + * <li> {@link org.bouncycastle.asn1.ASN1Sequence#getInstance(java.lang.Object) ASN1Sequence} input formats * </ul> * * @param obj the object we want converted. diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/EncryptedContentInfo.java b/core/src/main/java/org/bouncycastle/asn1/cms/EncryptedContentInfo.java index dc1996eb..64d887d6 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/EncryptedContentInfo.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/EncryptedContentInfo.java @@ -58,13 +58,13 @@ public class EncryptedContentInfo } /** - * return an EncryptedContentInfo object from the given object. + * Return an EncryptedContentInfo object from the given object. * <p> * Accepted inputs: * <ul> + * <li> null → null * <li> {@link EncryptedContentInfo} object - * <li> {@link org.bouncycastle.asn1.ASN1Sequence ASN1Sequence} input formats - * <li> null -> null + * <li> {@link org.bouncycastle.asn1.ASN1Sequence#getInstance(java.lang.Object) ASN1Sequence} input formats * </ul> * * @param obj the object we want converted. diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/EncryptedContentInfoParser.java b/core/src/main/java/org/bouncycastle/asn1/cms/EncryptedContentInfoParser.java index 1e6f0405..77fb0bbf 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/EncryptedContentInfoParser.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/EncryptedContentInfoParser.java @@ -9,6 +9,8 @@ import org.bouncycastle.asn1.ASN1TaggedObjectParser; import org.bouncycastle.asn1.x509.AlgorithmIdentifier; /** + * Parser for <a href="http://tools.ietf.org/html/rfc5652#section-6.1">RFC 5652</a> EncryptedContentInfo object. + * <p> * <pre> * EncryptedContentInfo ::= SEQUENCE { * contentType ContentType, diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/EncryptedData.java b/core/src/main/java/org/bouncycastle/asn1/cms/EncryptedData.java index 36048dcb..43ed7b48 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/EncryptedData.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/EncryptedData.java @@ -10,11 +10,13 @@ import org.bouncycastle.asn1.BERSequence; import org.bouncycastle.asn1.BERTaggedObject; /** + * <a href="http://tools.ietf.org/html/rfc5652#section-8">RFC 5652</a> EncryptedData object. + * <p> * <pre> - * EncryptedData ::= SEQUENCE { - * version CMSVersion, - * encryptedContentInfo EncryptedContentInfo, - * unprotectedAttrs [1] IMPLICIT UnprotectedAttributes OPTIONAL } + * EncryptedData ::= SEQUENCE { + * version CMSVersion, + * encryptedContentInfo EncryptedContentInfo, + * unprotectedAttrs [1] IMPLICIT UnprotectedAttributes OPTIONAL } * </pre> */ @@ -31,9 +33,9 @@ public class EncryptedData * <p> * Accepted inputs: * <ul> + * <li> null → null * <li> {@link EncryptedData} object - * <li> {@link org.bouncycastle.asn1.ASN1Sequence ASN1Sequence} input formats - * <li> null -> null + * <li> {@link org.bouncycastle.asn1.ASN1Sequence#getInstance(java.lang.Object) ASN1Sequence} input formats * </ul> * * @param o the object we want converted. diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/EnvelopedData.java b/core/src/main/java/org/bouncycastle/asn1/cms/EnvelopedData.java index fb6b2b73..994575a5 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/EnvelopedData.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/EnvelopedData.java @@ -13,7 +13,7 @@ import org.bouncycastle.asn1.BERSequence; import org.bouncycastle.asn1.DERTaggedObject; /** - * <a href="http://tools.ietf.org/html/rfc5652#section-6.1">RFC 5652</a> + * <a href="http://tools.ietf.org/html/rfc5652#section-6.1">RFC 5652</a> EnvelopedData object. * <pre> * EnvelopedData ::= SEQUENCE { * version CMSVersion, @@ -90,7 +90,7 @@ public class EnvelopedData } /** - * return an EnvelopedData object from a tagged object. + * Return an EnvelopedData object from a tagged object. * * @param obj the tagged object holding the object we want. * @param explicit true if the object is meant to be explicitly @@ -106,13 +106,13 @@ public class EnvelopedData } /** - * return an EnvelopedData object from the given object. + * Return an EnvelopedData object from the given object. * <p> * Accepted inputs: * <ul> + * <li> null → null * <li> {@link EnvelopedData} object - * <li> {@link org.bouncycastle.asn1.ASN1Sequence ASN1Sequence} input formats with EnvelopedData structure inside - * <li> null -> null + * <li> {@link org.bouncycastle.asn1.ASN1Sequence#getInstance(java.lang.Object) ASN1Sequence} input formats with EnvelopedData structure inside * </ul> * * @param obj the object we want converted. diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/EnvelopedDataParser.java b/core/src/main/java/org/bouncycastle/asn1/cms/EnvelopedDataParser.java index fb79c445..774813af 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/EnvelopedDataParser.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/EnvelopedDataParser.java @@ -10,7 +10,8 @@ import org.bouncycastle.asn1.ASN1TaggedObjectParser; import org.bouncycastle.asn1.BERTags; /** - * <a href="http://tools.ietf.org/html/rfc5652#section-6.1">RFC 5652</a> + * Parser of <a href="http://tools.ietf.org/html/rfc5652#section-6.1">RFC 5652</a> {@link EnvelopedData} object. + * <p> * <pre> * EnvelopedData ::= SEQUENCE { * version CMSVersion, diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/Evidence.java b/core/src/main/java/org/bouncycastle/asn1/cms/Evidence.java index eb102796..9bfdaa23 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/Evidence.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/Evidence.java @@ -7,13 +7,15 @@ import org.bouncycastle.asn1.ASN1TaggedObject; import org.bouncycastle.asn1.DERTaggedObject; /** - * <a href="http://tools.ietf.org/html/rfc5544">RFC 5544</a> "Syntax for Binding Documents with Time-Stamps": + * <a href="http://tools.ietf.org/html/rfc5544">RFC 5544</a>: + * Binding Documents with Time-Stamps; Evidence object. + * <p> * <pre> - * Evidence ::= CHOICE { - * tstEvidence [0] TimeStampTokenEvidence, -- see RFC 3161 - * ersEvidence [1] EvidenceRecord, -- see RFC 4998 - * otherEvidence [2] OtherEvidence - * } + * Evidence ::= CHOICE { + * tstEvidence [0] TimeStampTokenEvidence, -- see RFC 3161 + * ersEvidence [1] EvidenceRecord, -- see RFC 4998 + * otherEvidence [2] OtherEvidence + * } * </pre> */ diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/IssuerAndSerialNumber.java b/core/src/main/java/org/bouncycastle/asn1/cms/IssuerAndSerialNumber.java index e9b07611..3ef879d2 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/IssuerAndSerialNumber.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/IssuerAndSerialNumber.java @@ -14,7 +14,8 @@ import org.bouncycastle.asn1.x509.X509CertificateStructure; import org.bouncycastle.asn1.x509.X509Name; /** - * <a href="http://tools.ietf.org/html/rfc5652#section-10.2.4">RFC 5652</a>: + * <a href="http://tools.ietf.org/html/rfc5652#section-10.2.4">RFC 5652</a>: IssuerAndSerialNumber object. + * <p> * <pre> * IssuerAndSerialNumber ::= SEQUENCE { * issuer Name, @@ -35,9 +36,9 @@ public class IssuerAndSerialNumber * <p> * Accepted inputs: * <ul> + * <li> null → null * <li> {@link IssuerAndSerialNumber} object - * <li> {@link org.bouncycastle.asn1.ASN1Sequence ASN1Sequence} input formats with IssuerAndSerialNumber structure inside - * <li> null -> null + * <li> {@link org.bouncycastle.asn1.ASN1Sequence#getInstance(java.lang.Object) ASN1Sequence} input formats with IssuerAndSerialNumber structure inside * </ul> * * @param o the object we want converted. diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/KEKIdentifier.java b/core/src/main/java/org/bouncycastle/asn1/cms/KEKIdentifier.java index 01f58368..0361e9fb 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/KEKIdentifier.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/KEKIdentifier.java @@ -12,6 +12,8 @@ import org.bouncycastle.asn1.DERSequence; /** * <a href="http://tools.ietf.org/html/rfc5652#section-6.2.3">RFC 5652</a>: + * Content encryption key delivery mechanisms. + * <p> * <pre> * KEKIdentifier ::= SEQUENCE { * keyIdentifier OCTET STRING, @@ -66,7 +68,7 @@ public class KEKIdentifier } /** - * return a KEKIdentifier object from a tagged object. + * Return a KEKIdentifier object from a tagged object. * * @param obj the tagged object holding the object we want. * @param explicit true if the object is meant to be explicitly @@ -82,12 +84,13 @@ public class KEKIdentifier } /** - * return a KEKIdentifier object from the given object. + * Return a KEKIdentifier object from the given object. * <p> * Accepted inputs: * <ul> + * <li> null → null * <li> {@link KEKIdentifier} object - * <li> {@link org.bouncycastle.asn1.ASN1Sequence ASN1Sequence} input formats with KEKIdentifier structure inside + * <li> {@link org.bouncycastle.asn1.ASN1Sequence#getInstance(java.lang.Object) ASN1Sequence} input formats with KEKIdentifier structure inside * </ul> * * @param obj the object we want converted. diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/KEKRecipientInfo.java b/core/src/main/java/org/bouncycastle/asn1/cms/KEKRecipientInfo.java index 7aaf700b..91789cd6 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/KEKRecipientInfo.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/KEKRecipientInfo.java @@ -12,6 +12,8 @@ import org.bouncycastle.asn1.x509.AlgorithmIdentifier; /** * <a href="http://tools.ietf.org/html/rfc5652#section-6.2.3">RFC 5652</a>: + * Content encryption key delivery mechanisms. + * <p> * <pre> * KEKRecipientInfo ::= SEQUENCE { * version CMSVersion, -- always set to 4 @@ -50,7 +52,7 @@ public class KEKRecipientInfo } /** - * return a KEKRecipientInfo object from a tagged object. + * Return a KEKRecipientInfo object from a tagged object. * * @param obj the tagged object holding the object we want. * @param explicit true if the object is meant to be explicitly @@ -66,13 +68,13 @@ public class KEKRecipientInfo } /** - * return a KEKRecipientInfo object from the given object. + * Return a KEKRecipientInfo object from the given object. * <p> * Accepted inputs: * <ul> + * <li> null → null * <li> {@link KEKRecipientInfo} object - * <li> {@link org.bouncycastle.asn1.ASN1Sequence ASN1Sequence} input formats with KEKRecipientInfo structure inside - * <li> null -> null + * <li> {@link org.bouncycastle.asn1.ASN1Sequence#getInstance(java.lang.Object) ASN1Sequence} input formats with KEKRecipientInfo structure inside * </ul> * * @param obj the object we want converted. diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/KeyAgreeRecipientIdentifier.java b/core/src/main/java/org/bouncycastle/asn1/cms/KeyAgreeRecipientIdentifier.java index e2e0a62f..e281f12a 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/KeyAgreeRecipientIdentifier.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/KeyAgreeRecipientIdentifier.java @@ -9,6 +9,8 @@ import org.bouncycastle.asn1.DERTaggedObject; /** * <a href="http://tools.ietf.org/html/rfc5652#section-6.2.2">RFC 5652</a>: + * Content encryption key delivery mechanisms. + * <p> * <pre> * KeyAgreeRecipientIdentifier ::= CHOICE { * issuerAndSerialNumber IssuerAndSerialNumber, @@ -23,7 +25,7 @@ public class KeyAgreeRecipientIdentifier private RecipientKeyIdentifier rKeyID; /** - * return an KeyAgreeRecipientIdentifier object from a tagged object. + * Return an KeyAgreeRecipientIdentifier object from a tagged object. * * @param obj the tagged object holding the object we want. * @param explicit true if the object is meant to be explicitly @@ -39,12 +41,12 @@ public class KeyAgreeRecipientIdentifier } /** - * return an KeyAgreeRecipientIdentifier object from the given object. + * Return an KeyAgreeRecipientIdentifier object from the given object. * <p> * Accepted inputs: * <ul> * <li> {@link KeyAgreeRecipientIdentifier} object - * <li> {@link org.bouncycastle.asn1.ASN1Sequence ASN1Sequence} input formats with IssuerAndSerialNumber structure inside + * <li> {@link org.bouncycastle.asn1.ASN1Sequence#getInstance(java.lang.Object) ASN1Sequence} input formats with IssuerAndSerialNumber structure inside * <li> {@link org.bouncycastle.asn1.ASN1TaggedObject ASN1TaggedObject} with tag value 0: a KeyAgreeRecipientIdentifier data structure * </ul> * <p> diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/KeyAgreeRecipientInfo.java b/core/src/main/java/org/bouncycastle/asn1/cms/KeyAgreeRecipientInfo.java index a9d326ba..7a008c88 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/KeyAgreeRecipientInfo.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/KeyAgreeRecipientInfo.java @@ -13,6 +13,8 @@ import org.bouncycastle.asn1.x509.AlgorithmIdentifier; /** * <a href="http://tools.ietf.org/html/rfc5652#section-6.2.2">RFC 5652</a>: + * Content encryption key delivery mechanisms. + * <p> * <pre> * KeyAgreeRecipientInfo ::= SEQUENCE { * version CMSVersion, -- always set to 3 @@ -69,7 +71,7 @@ public class KeyAgreeRecipientInfo } /** - * return a KeyAgreeRecipientInfo object from a tagged object. + * Return a KeyAgreeRecipientInfo object from a tagged object. * * @param obj the tagged object holding the object we want. * @param explicit true if the object is meant to be explicitly @@ -85,12 +87,13 @@ public class KeyAgreeRecipientInfo } /** - * return a KeyAgreeRecipientInfo object from the given object. + * Return a KeyAgreeRecipientInfo object from the given object. * <p> * Accepted inputs: * <ul> + * <li> null → null * <li> {@link KeyAgreeRecipientInfo} object - * <li> {@link org.bouncycastle.asn1.ASN1Sequence ASN1Sequence} input formats with KeyAgreeRecipientInfo structure inside + * <li> {@link org.bouncycastle.asn1.ASN1Sequence#getInstance(java.lang.Object) ASN1Sequence} input formats with KeyAgreeRecipientInfo structure inside * </ul> * * @param obj the object we want converted. diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/KeyTransRecipientInfo.java b/core/src/main/java/org/bouncycastle/asn1/cms/KeyTransRecipientInfo.java index b70df9f4..8eb350d5 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/KeyTransRecipientInfo.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/KeyTransRecipientInfo.java @@ -12,6 +12,7 @@ import org.bouncycastle.asn1.x509.AlgorithmIdentifier; /** * <a href="http://tools.ietf.org/html/rfc5652#section-6.2.1">RFC 5652</a>: + * Content encryption key delivery mechanisms. * <pre> * KeyTransRecipientInfo ::= SEQUENCE { * version CMSVersion, -- always set to 0 or 2 @@ -58,12 +59,13 @@ public class KeyTransRecipientInfo } /** - * return a KeyTransRecipientInfo object from the given object. + * Return a KeyTransRecipientInfo object from the given object. * <p> * Accepted inputs: * <ul> + * <li> null → null * <li> {@link KeyTransRecipientInfo} object - * <li> {@link org.bouncycastle.asn1.ASN1Sequence ASN1Sequence} input formats with KeyTransRecipientInfo structure inside + * <li> {@link org.bouncycastle.asn1.ASN1Sequence#getInstance(java.lang.Object) ASN1Sequence} input formats with KeyTransRecipientInfo structure inside * </ul> * * @param obj the object we want converted. diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/MetaData.java b/core/src/main/java/org/bouncycastle/asn1/cms/MetaData.java index f2e002d5..667187b3 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/MetaData.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/MetaData.java @@ -11,6 +11,8 @@ import org.bouncycastle.asn1.DERUTF8String; /** * <a href="http://tools.ietf.org/html/rfc5544">RFC 5544</a>: + * Binding Documents with Time-Stamps; MetaData object. + * <p> * <pre> * MetaData ::= SEQUENCE { * hashProtected BOOLEAN, @@ -61,13 +63,13 @@ public class MetaData } /** - * return a MetaData object from the given object. + * Return a MetaData object from the given object. * <p> * Accepted inputs: * <ul> + * <li> null → null * <li> {@link MetaData} object - * <li> {@link org.bouncycastle.asn1.ASN1Sequence ASN1Sequence} input formats with MetaData structure inside - * <li> null -> null + * <li> {@link org.bouncycastle.asn1.ASN1Sequence#getInstance(java.lang.Object) ASN1Sequence} input formats with MetaData structure inside * </ul> * * @param obj the object we want converted. diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/OriginatorIdentifierOrKey.java b/core/src/main/java/org/bouncycastle/asn1/cms/OriginatorIdentifierOrKey.java index 93581f2e..aa27d873 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/OriginatorIdentifierOrKey.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/OriginatorIdentifierOrKey.java @@ -11,6 +11,7 @@ import org.bouncycastle.asn1.x509.SubjectKeyIdentifier; /** * <a href="http://tools.ietf.org/html/rfc5652#section-6.2.2">RFC 5652</a>: + * Content encryption key delivery mechanisms. * <pre> * OriginatorIdentifierOrKey ::= CHOICE { * issuerAndSerialNumber IssuerAndSerialNumber, @@ -64,7 +65,7 @@ public class OriginatorIdentifierOrKey } /** - * return an OriginatorIdentifierOrKey object from a tagged object. + * Return an OriginatorIdentifierOrKey object from a tagged object. * * @param o the tagged object holding the object we want. * @param explicit true if the object is meant to be explicitly @@ -86,10 +87,11 @@ public class OriginatorIdentifierOrKey } /** - * return an OriginatorIdentifierOrKey object from the given object. + * Return an OriginatorIdentifierOrKey object from the given object. * <p> * Accepted inputs: * <ul> + * <li> null → null * <li> {@link OriginatorIdentifierOrKey} object * <li> {@link IssuerAndSerialNumber} object * <li> {@link SubjectKeyIdentifier} object diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/OriginatorInfo.java b/core/src/main/java/org/bouncycastle/asn1/cms/OriginatorInfo.java index a2395996..96abf7d6 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/OriginatorInfo.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/OriginatorInfo.java @@ -10,7 +10,7 @@ import org.bouncycastle.asn1.DERSequence; import org.bouncycastle.asn1.DERTaggedObject; /** - * <a href="http://tools.ietf.org/html/rfc5652#section-6.2.1">RFC 5652</a>: + * <a href="http://tools.ietf.org/html/rfc5652#section-6.2.1">RFC 5652</a>: OriginatorInfo object. * <pre> * RFC 3369: * @@ -84,7 +84,7 @@ public class OriginatorInfo } /** - * return an OriginatorInfo object from a tagged object. + * Return an OriginatorInfo object from a tagged object. * * @param obj the tagged object holding the object we want. * @param explicit true if the object is meant to be explicitly @@ -100,13 +100,13 @@ public class OriginatorInfo } /** - * return an OriginatorInfo object from the given object. + * Return an OriginatorInfo object from the given object. * <p> * Accepted inputs: * <ul> - * <li> null -> null + * <li> null → null * <li> {@link OriginatorInfo} object - * <li> {@link org.bouncycastle.asn1.ASN1Sequence ASN1Sequence} input formats with OriginatorInfo structure inside + * <li> {@link org.bouncycastle.asn1.ASN1Sequence#getInstance(java.lang.Object) ASN1Sequence} input formats with OriginatorInfo structure inside * </ul> * * @param obj the object we want converted. @@ -115,11 +115,16 @@ public class OriginatorInfo public static OriginatorInfo getInstance( Object obj) { - if (obj == null || obj instanceof OriginatorInfo) + if (obj instanceof OriginatorInfo) { return (OriginatorInfo)obj; } - return new OriginatorInfo(ASN1Sequence.getInstance(obj)); + else if (obj != null) + { + return new OriginatorInfo(ASN1Sequence.getInstance(obj)); + } + + return null; } public ASN1Set getCertificates() diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/OriginatorPublicKey.java b/core/src/main/java/org/bouncycastle/asn1/cms/OriginatorPublicKey.java index 6bcd3fff..94c70e75 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/OriginatorPublicKey.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/OriginatorPublicKey.java @@ -11,6 +11,8 @@ import org.bouncycastle.asn1.x509.AlgorithmIdentifier; /** * <a href="http://tools.ietf.org/html/rfc5652#section-6.2.2">RFC 5652</a>: + * Content encryption key delivery mechanisms. + * <p> * <pre> * OriginatorPublicKey ::= SEQUENCE { * algorithm AlgorithmIdentifier, @@ -41,7 +43,7 @@ public class OriginatorPublicKey } /** - * return an OriginatorPublicKey object from a tagged object. + * Return an OriginatorPublicKey object from a tagged object. * * @param obj the tagged object holding the object we want. * @param explicit true if the object is meant to be explicitly @@ -57,13 +59,13 @@ public class OriginatorPublicKey } /** - * return an OriginatorPublicKey object from the given object. + * Return an OriginatorPublicKey object from the given object. * <p> * Accepted inputs: * <ul> - * <li> null -> null + * <li> null → null * <li> {@link OriginatorPublicKey} object - * <li> {@link org.bouncycastle.asn1.ASN1Sequence ASN1Sequence} input formats with OriginatorPublicKey structure inside + * <li> {@link org.bouncycastle.asn1.ASN1Sequence#getInstance(java.lang.Object) ASN1Sequence} input formats with OriginatorPublicKey structure inside * </ul> * * @param obj the object we want converted. diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/OtherKeyAttribute.java b/core/src/main/java/org/bouncycastle/asn1/cms/OtherKeyAttribute.java index 9c62a0c6..6a8656e1 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/OtherKeyAttribute.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/OtherKeyAttribute.java @@ -9,7 +9,8 @@ import org.bouncycastle.asn1.ASN1Sequence; import org.bouncycastle.asn1.DERSequence; /** - * <a href="http://tools.ietf.org/html/rfc5652#section-10.2.7">RFC 5652</a>: + * <a href="http://tools.ietf.org/html/rfc5652#section-10.2.7">RFC 5652</a>: OtherKeyAttribute object. + * <p> * <pre> * OtherKeyAttribute ::= SEQUENCE { * keyAttrId OBJECT IDENTIFIER, @@ -24,13 +25,13 @@ public class OtherKeyAttribute private ASN1Encodable keyAttr; /** - * return an OtherKeyAttribute object from the given object. + * Return an OtherKeyAttribute object from the given object. * <p> * Accepted inputs: * <ul> - * <li> null -> null + * <li> null → null * <li> {@link OtherKeyAttribute} object - * <li> {@link org.bouncycastle.asn1.ASN1Sequence ASN1Sequence} input formats with OtherKeyAttribute structure inside + * <li> {@link org.bouncycastle.asn1.ASN1Sequence#getInstance(java.lang.Object) ASN1Sequence} input formats with OtherKeyAttribute structure inside * </ul> * * @param o the object we want converted. diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/OtherRecipientInfo.java b/core/src/main/java/org/bouncycastle/asn1/cms/OtherRecipientInfo.java index ef94d185..4f9b618a 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/OtherRecipientInfo.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/OtherRecipientInfo.java @@ -11,6 +11,7 @@ import org.bouncycastle.asn1.DERSequence; /** * <a href="http://tools.ietf.org/html/rfc5652#section-6.2.5">RFC 5652</a>: + * Content encryption key delivery mechanisms. * <pre> * OtherRecipientInfo ::= SEQUENCE { * oriType OBJECT IDENTIFIER, @@ -43,7 +44,7 @@ public class OtherRecipientInfo } /** - * return a OtherRecipientInfo object from a tagged object. + * Return a OtherRecipientInfo object from a tagged object. * * @param obj the tagged object holding the object we want. * @param explicit true if the object is meant to be explicitly @@ -59,13 +60,13 @@ public class OtherRecipientInfo } /** - * return a OtherRecipientInfo object from the given object. + * Return a OtherRecipientInfo object from the given object. * <p> * Accepted inputs: * <ul> - * <li> null -> null + * <li> null → null * <li> {@link PasswordRecipientInfo} object - * <li> {@link org.bouncycastle.asn1.ASN1Sequence ASN1Sequence} input formats with OtherRecipientInfo structure inside + * <li> {@link org.bouncycastle.asn1.ASN1Sequence#getInstance(java.lang.Object) ASN1Sequence} input formats with OtherRecipientInfo structure inside * </ul> * * @param obj the object we want converted. @@ -74,12 +75,17 @@ public class OtherRecipientInfo public static OtherRecipientInfo getInstance( Object obj) { - if (obj == null || obj instanceof OtherRecipientInfo) + if (obj instanceof OtherRecipientInfo) { return (OtherRecipientInfo)obj; } - - return new OtherRecipientInfo(ASN1Sequence.getInstance(obj)); + + if (obj != null) + { + return new OtherRecipientInfo(ASN1Sequence.getInstance(obj)); + } + + return null; } public ASN1ObjectIdentifier getType() diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/OtherRevocationInfoFormat.java b/core/src/main/java/org/bouncycastle/asn1/cms/OtherRevocationInfoFormat.java index 0185b8a0..f635f896 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/OtherRevocationInfoFormat.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/OtherRevocationInfoFormat.java @@ -10,7 +10,8 @@ import org.bouncycastle.asn1.ASN1TaggedObject; import org.bouncycastle.asn1.DERSequence; /** - * <a href="http://tools.ietf.org/html/rfc5652#section-10.2.1">RFC 5652</a>: + * <a href="http://tools.ietf.org/html/rfc5652#section-10.2.1">RFC 5652</a>: OtherRevocationInfoFormat object. + * <p> * <pre> * OtherRevocationInfoFormat ::= SEQUENCE { * otherRevInfoFormat OBJECT IDENTIFIER, @@ -40,7 +41,7 @@ public class OtherRevocationInfoFormat } /** - * return a OtherRevocationInfoFormat object from a tagged object. + * Return a OtherRevocationInfoFormat object from a tagged object. * * @param obj the tagged object holding the object we want. * @param explicit true if the object is meant to be explicitly @@ -56,13 +57,13 @@ public class OtherRevocationInfoFormat } /** - * return a OtherRevocationInfoFormat object from the given object. + * Return a OtherRevocationInfoFormat object from the given object. * <p> * Accepted inputs: * <ul> - * <li> null -> null + * <li> null → null * <li> {@link OtherRevocationInfoFormat} object - * <li> {@link org.bouncycastle.asn1.ASN1Sequence ASN1Sequence} input formats with OtherRevocationInfoFormat structure inside + * <li> {@link org.bouncycastle.asn1.ASN1Sequence#getInstance(java.lang.Object) ASN1Sequence} input formats with OtherRevocationInfoFormat structure inside * </ul> * * @param obj the object we want converted. @@ -71,12 +72,17 @@ public class OtherRevocationInfoFormat public static OtherRevocationInfoFormat getInstance( Object obj) { - if (obj == null || obj instanceof OtherRevocationInfoFormat) + if (obj instanceof OtherRevocationInfoFormat) { return (OtherRevocationInfoFormat)obj; } - - return new OtherRevocationInfoFormat(ASN1Sequence.getInstance(obj)); + + if (obj != null) + { + return new OtherRevocationInfoFormat(ASN1Sequence.getInstance(obj)); + } + + return null; } public ASN1ObjectIdentifier getInfoFormat() diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/PasswordRecipientInfo.java b/core/src/main/java/org/bouncycastle/asn1/cms/PasswordRecipientInfo.java index 420b38f8..60e3b5a1 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/PasswordRecipientInfo.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/PasswordRecipientInfo.java @@ -13,6 +13,7 @@ import org.bouncycastle.asn1.x509.AlgorithmIdentifier; /** * <a href="http://tools.ietf.org/html/rfc5652#section-10.2.7">RFC 5652</a>: + * Content encryption key delivery mechanisms. * <pre> * PasswordRecipientInfo ::= SEQUENCE { * version CMSVersion, -- Always set to 0 @@ -68,7 +69,7 @@ public class PasswordRecipientInfo } /** - * return a PasswordRecipientInfo object from a tagged object. + * Return a PasswordRecipientInfo object from a tagged object. * * @param obj the tagged object holding the object we want. * @param explicit true if the object is meant to be explicitly @@ -84,13 +85,13 @@ public class PasswordRecipientInfo } /** - * return a PasswordRecipientInfo object from the given object. + * Return a PasswordRecipientInfo object from the given object. * <p> * Accepted inputs: * <ul> - * <li> null -> null + * <li> null → null * <li> {@link PasswordRecipientInfo} object - * <li> {@link org.bouncycastle.asn1.ASN1Sequence ASN1Sequence} input formats with PasswordRecipientInfo structure inside + * <li> {@link org.bouncycastle.asn1.ASN1Sequence#getInstance(java.lang.Object) ASN1Sequence} input formats with PasswordRecipientInfo structure inside * </ul> * * @param obj the object we want converted. diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/RecipientEncryptedKey.java b/core/src/main/java/org/bouncycastle/asn1/cms/RecipientEncryptedKey.java index f1d3fe05..a7ea27ee 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/RecipientEncryptedKey.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/RecipientEncryptedKey.java @@ -10,6 +10,7 @@ import org.bouncycastle.asn1.DERSequence; /** * <a href="http://tools.ietf.org/html/rfc5652#section-6.2.2">RFC 5652</a>: + * Content encryption key delivery mechanisms. * <pre> * RecipientEncryptedKey ::= SEQUENCE { * rid KeyAgreeRecipientIdentifier, @@ -32,7 +33,7 @@ public class RecipientEncryptedKey } /** - * return an RecipientEncryptedKey object from a tagged object. + * Return an RecipientEncryptedKey object from a tagged object. * * @param obj the tagged object holding the object we want. * @param explicit true if the object is meant to be explicitly @@ -48,13 +49,13 @@ public class RecipientEncryptedKey } /** - * return a RecipientEncryptedKey object from the given object. + * Return a RecipientEncryptedKey object from the given object. * <p> * Accepted inputs: * <ul> - * <li> null -> null + * <li> null → null * <li> {@link RecipientEncryptedKey} object - * <li> {@link org.bouncycastle.asn1.ASN1Sequence ASN1Sequence} input formats with RecipientEncryptedKey structure inside + * <li> {@link org.bouncycastle.asn1.ASN1Sequence#getInstance(java.lang.Object) ASN1Sequence} input formats with RecipientEncryptedKey structure inside * </ul> * * @param obj the object we want converted. diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/RecipientIdentifier.java b/core/src/main/java/org/bouncycastle/asn1/cms/RecipientIdentifier.java index 7c09a704..d23ceaa8 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/RecipientIdentifier.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/RecipientIdentifier.java @@ -10,6 +10,7 @@ import org.bouncycastle.asn1.DERTaggedObject; /** * <a href="http://tools.ietf.org/html/rfc5652#section-6.2.1">RFC 5652</a>: + * Content encryption key delivery mechanisms. * <pre> * RecipientIdentifier ::= CHOICE { * issuerAndSerialNumber IssuerAndSerialNumber, @@ -44,11 +45,11 @@ public class RecipientIdentifier } /** - * return a RecipientIdentifier object from the given object. + * Return a RecipientIdentifier object from the given object. * <p> * Accepted inputs: * <ul> - * <li> null -> null + * <li> null → null * <li> {@link RecipientIdentifier} object * <li> {@link IssuerAndSerialNumber} object * <li> {@link org.bouncycastle.asn1.ASN1OctetString ASN1OctetString} input formats (OctetString, byte[]) with value of KeyIdentifier in DER form. diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/RecipientInfo.java b/core/src/main/java/org/bouncycastle/asn1/cms/RecipientInfo.java index 00ca03a6..8fd2e546 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/RecipientInfo.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/RecipientInfo.java @@ -11,6 +11,8 @@ import org.bouncycastle.asn1.DERTaggedObject; /** * <a href="http://tools.ietf.org/html/rfc5652#section-6.2">RFC 5652</a>: + * Content encryption key delivery mechanisms. + * <p> * <pre> * RecipientInfo ::= CHOICE { * ktri KeyTransRecipientInfo, @@ -63,13 +65,13 @@ public class RecipientInfo } /** - * return a RecipientInfo object from the given object. + * Return a RecipientInfo object from the given object. * <p> * Accepted inputs: * <ul> - * <li> null -> null + * <li> null → null * <li> {@link RecipientInfo} object - * <li> {@link org.bouncycastle.asn1.ASN1Sequence ASN1Sequence} input formats with RecipientInfo structure inside + * <li> {@link org.bouncycastle.asn1.ASN1Sequence#getInstance(java.lang.Object) ASN1Sequence} input formats with RecipientInfo structure inside * <li> {@link org.bouncycastle.asn1.ASN1TaggedObject ASN1TaggedObject} input formats with RecipientInfo structure inside * </ul> * diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/RecipientKeyIdentifier.java b/core/src/main/java/org/bouncycastle/asn1/cms/RecipientKeyIdentifier.java index 070cec42..66ea8970 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/RecipientKeyIdentifier.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/RecipientKeyIdentifier.java @@ -12,6 +12,8 @@ import org.bouncycastle.asn1.DERSequence; /** * <a href="http://tools.ietf.org/html/rfc5652#section-6.2.2">RFC 5652</a>: + * Content encryption key delivery mechanisms. + * <p> * <pre> * RecipientKeyIdentifier ::= SEQUENCE { * subjectKeyIdentifier SubjectKeyIdentifier, @@ -85,7 +87,7 @@ public class RecipientKeyIdentifier } /** - * return a RecipientKeyIdentifier object from a tagged object. + * Return a RecipientKeyIdentifier object from a tagged object. * * @param _ato the tagged object holding the object we want. * @param _explicit true if the object is meant to be explicitly @@ -99,13 +101,13 @@ public class RecipientKeyIdentifier } /** - * return a RecipientKeyIdentifier object from the given object. + * Return a RecipientKeyIdentifier object from the given object. * <p> * Accepted inputs: * <ul> - * <li> null -> null + * <li> null → null * <li> {@link RecipientKeyIdentifier} object - * <li> {@link org.bouncycastle.asn1.ASN1Sequence ASN1Sequence} input formats with RecipientKeyIdentifier structure inside + * <li> {@link org.bouncycastle.asn1.ASN1Sequence#getInstance(java.lang.Object) ASN1Sequence} input formats with RecipientKeyIdentifier structure inside * </ul> * * @param _obj the object we want converted. diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/SCVPReqRes.java b/core/src/main/java/org/bouncycastle/asn1/cms/SCVPReqRes.java index c7459683..52279c33 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/SCVPReqRes.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/SCVPReqRes.java @@ -10,12 +10,12 @@ import org.bouncycastle.asn1.DERTaggedObject; /** * <a href="http://tools.ietf.org/html/rfc5940">RFC 5940</a>: - * "Additional Cryptographic Message Syntax (CMS) Revocation Information Choices" + * Additional Cryptographic Message Syntax (CMS) Revocation Information Choices. * <p> * <pre> - * SCVPReqRes ::= SEQUENCE { - * request [0] EXPLICIT ContentInfo OPTIONAL, - * response ContentInfo } + * SCVPReqRes ::= SEQUENCE { + * request [0] EXPLICIT ContentInfo OPTIONAL, + * response ContentInfo } * </pre> */ public class SCVPReqRes @@ -25,13 +25,13 @@ public class SCVPReqRes private final ContentInfo response; /** - * return a SCVPReqRes object from the given object. + * Return a SCVPReqRes object from the given object. * <p> * Accepted inputs: * <ul> - * <li> null -> null + * <li> null → null * <li> {@link SCVPReqRes} object - * <li> {@link org.bouncycastle.asn1.ASN1Sequence ASN1Sequence} input formats with SCVPReqRes structure inside + * <li> {@link org.bouncycastle.asn1.ASN1Sequence#getInstance(java.lang.Object) ASN1Sequence} input formats with SCVPReqRes structure inside * </ul> * * @param obj the object we want converted. @@ -40,11 +40,16 @@ public class SCVPReqRes public static SCVPReqRes getInstance( Object obj) { - if (obj == null || obj instanceof SCVPReqRes) + if (obj instanceof SCVPReqRes) { return (SCVPReqRes)obj; } - return new SCVPReqRes(ASN1Sequence.getInstance(obj)); + else if (obj != null) + { + return new SCVPReqRes(ASN1Sequence.getInstance(obj)); + } + + return null; } private SCVPReqRes( diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/SignedData.java b/core/src/main/java/org/bouncycastle/asn1/cms/SignedData.java index b192d781..0d528bd4 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/SignedData.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/SignedData.java @@ -18,7 +18,7 @@ import org.bouncycastle.asn1.DERTaggedObject; /** * <a href="http://tools.ietf.org/html/rfc5652#section-5.1">RFC 5652</a>: * <p> - * A signed data object. + * A signed data object containing multitude of {@link SignerInfo}s. * <pre> * SignedData ::= SEQUENCE { * version CMSVersion, @@ -28,7 +28,33 @@ import org.bouncycastle.asn1.DERTaggedObject; * crls [1] IMPLICIT CertificateRevocationLists OPTIONAL, * signerInfos SignerInfos * } + * + * DigestAlgorithmIdentifiers ::= SET OF DigestAlgorithmIdentifier + * + * SignerInfos ::= SET OF SignerInfo * </pre> + * <p> + * The version calculation uses following ruleset from RFC 3852 section 5.1: + * <pre> + * IF ((certificates is present) AND + * (any certificates with a type of other are present)) OR + * ((crls is present) AND + * (any crls with a type of other are present)) + * THEN version MUST be 5 + * ELSE + * IF (certificates is present) AND + * (any version 2 attribute certificates are present) + * THEN version MUST be 4 + * ELSE + * IF ((certificates is present) AND + * (any version 1 attribute certificates are present)) OR + * (any SignerInfo structures are version 3) OR + * (encapContentInfo eContentType is other than id-data) + * THEN version MUST be 3 + * ELSE version MUST be 1 + * </pre> + * <p> + * @todo Check possible update for this to RFC 5652 level */ public class SignedData extends ASN1Object @@ -48,13 +74,13 @@ public class SignedData private boolean crlsBer; /** - * return a SignedData object from the given object. + * Return a SignedData object from the given object. * <p> * Accepted inputs: * <ul> - * <li> null -> null + * <li> null → null * <li> {@link SignedData} object - * <li> {@link org.bouncycastle.asn1.ASN1Sequence ASN1Sequence} input formats with SignedData structure inside + * <li> {@link org.bouncycastle.asn1.ASN1Sequence#getInstance(java.lang.Object) ASN1Sequence} input formats with SignedData structure inside * </ul> * * @param obj the object we want converted. @@ -63,11 +89,16 @@ public class SignedData public static SignedData getInstance( Object o) { - if (o == null || o instanceof SignedData) + if (o instanceof SignedData) { return (SignedData)o; } - return new SignedData(ASN1Sequence.getInstance(o)); + else if (o != null) + { + return new SignedData(ASN1Sequence.getInstance(o)); + } + + return null; } public SignedData( @@ -88,24 +119,6 @@ public class SignedData } - // RFC3852, section 5.1: - // IF ((certificates is present) AND - // (any certificates with a type of other are present)) OR - // ((crls is present) AND - // (any crls with a type of other are present)) - // THEN version MUST be 5 - // ELSE - // IF (certificates is present) AND - // (any version 2 attribute certificates are present) - // THEN version MUST be 4 - // ELSE - // IF ((certificates is present) AND - // (any version 1 attribute certificates are present)) OR - // (any SignerInfo structures are version 3) OR - // (encapContentInfo eContentType is other than id-data) - // THEN version MUST be 3 - // ELSE version MUST be 1 - // private ASN1Integer calculateVersion( ASN1ObjectIdentifier contentOid, ASN1Set certs, diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/SignedDataParser.java b/core/src/main/java/org/bouncycastle/asn1/cms/SignedDataParser.java index f8957a0e..df22b8e8 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/SignedDataParser.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/SignedDataParser.java @@ -11,7 +11,7 @@ import org.bouncycastle.asn1.ASN1TaggedObjectParser; import org.bouncycastle.asn1.BERTags; /** - * <a href="http://tools.ietf.org/html/rfc5652#section-5.1">RFC 5652</a>: + * Parser for <a href="http://tools.ietf.org/html/rfc5652#section-5.1">RFC 5652</a>: {@link SignedData} object. * <p> * <pre> * SignedData ::= SEQUENCE { diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/SignerIdentifier.java b/core/src/main/java/org/bouncycastle/asn1/cms/SignerIdentifier.java index a349fdd7..fddcb445 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/SignerIdentifier.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/SignerIdentifier.java @@ -10,7 +10,10 @@ import org.bouncycastle.asn1.DERTaggedObject; /** * <a href="http://tools.ietf.org/html/rfc5652#section-5.3">RFC 5652</a>: - * + * Identify who signed the containing {@link SignerInfo} object. + * <p> + * The certificates referred to by this are at containing {@link SignedData} structure. + * <p> * <pre> * SignerIdentifier ::= CHOICE { * issuerAndSerialNumber IssuerAndSerialNumber, @@ -46,11 +49,11 @@ public class SignerIdentifier } /** - * return a SignerIdentifier object from the given object. + * Return a SignerIdentifier object from the given object. * <p> * Accepted inputs: * <ul> - * <li> null -> null + * <li> null → null * <li> {@link SignerIdentifier} object * <li> {@link IssuerAndSerialNumber} object * <li> {@link org.bouncycastle.asn1.ASN1OctetString ASN1OctetString} input formats with SignerIdentifier structure inside diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/SignerInfo.java b/core/src/main/java/org/bouncycastle/asn1/cms/SignerInfo.java index c05d5137..d28e11f2 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/SignerInfo.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/SignerInfo.java @@ -16,22 +16,60 @@ import org.bouncycastle.asn1.DERTaggedObject; import org.bouncycastle.asn1.x509.AlgorithmIdentifier; /** + * <a href="http://tools.ietf.org/html/rfc5652#section-5.3">RFC 5652</a>: + * Signature container per Signer, see {@link SignerIdentifier}. * <pre> - * SignerInfo ::= SEQUENCE { - * version Version, - * SignerIdentifier sid, - * digestAlgorithm DigestAlgorithmIdentifier, - * authenticatedAttributes [0] IMPLICIT Attributes OPTIONAL, - * digestEncryptionAlgorithm DigestEncryptionAlgorithmIdentifier, - * encryptedDigest EncryptedDigest, - * unauthenticatedAttributes [1] IMPLICIT Attributes OPTIONAL - * } + * PKCS#7: * - * EncryptedDigest ::= OCTET STRING + * SignerInfo ::= SEQUENCE { + * version Version, + * sid SignerIdentifier, + * digestAlgorithm DigestAlgorithmIdentifier, + * authenticatedAttributes [0] IMPLICIT Attributes OPTIONAL, + * digestEncryptionAlgorithm DigestEncryptionAlgorithmIdentifier, + * encryptedDigest EncryptedDigest, + * unauthenticatedAttributes [1] IMPLICIT Attributes OPTIONAL + * } * - * DigestAlgorithmIdentifier ::= AlgorithmIdentifier + * EncryptedDigest ::= OCTET STRING * - * DigestEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier + * DigestAlgorithmIdentifier ::= AlgorithmIdentifier + * + * DigestEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier + * + * ----------------------------------------- + * + * RFC 5256: + * + * SignerInfo ::= SEQUENCE { + * version CMSVersion, + * sid SignerIdentifier, + * digestAlgorithm DigestAlgorithmIdentifier, + * signedAttrs [0] IMPLICIT SignedAttributes OPTIONAL, + * signatureAlgorithm SignatureAlgorithmIdentifier, + * signature SignatureValue, + * unsignedAttrs [1] IMPLICIT UnsignedAttributes OPTIONAL + * } + * + * -- {@link SignerIdentifier} referenced certificates are at containing + * -- {@link SignedData} certificates element. + * + * SignerIdentifier ::= CHOICE { + * issuerAndSerialNumber {@link IssuerAndSerialNumber}, + * subjectKeyIdentifier [0] SubjectKeyIdentifier } + * + * -- See {@link Attributes} for generalized SET OF {@link Attribute} + * + * SignedAttributes ::= SET SIZE (1..MAX) OF Attribute + * UnsignedAttributes ::= SET SIZE (1..MAX) OF Attribute + * + * {@link Attribute} ::= SEQUENCE { + * attrType OBJECT IDENTIFIER, + * attrValues SET OF AttributeValue } + * + * AttributeValue ::= ANY + * + * SignatureValue ::= OCTET STRING * </pre> */ @@ -47,13 +85,13 @@ public class SignerInfo private ASN1Set unauthenticatedAttributes; /** - * return a SignerInfo object from the given input + * Return a SignerInfo object from the given input * <p> * Accepted inputs: * <ul> - * <li> null -> null + * <li> null → null * <li> {@link SignerInfo} object - * <li> {@link org.bouncycastle.asn1.ASN1Sequence ASN1Sequence} input formats with SignerInfo structure inside + * <li> {@link org.bouncycastle.asn1.ASN1Sequence#getInstance(java.lang.Object) ASN1Sequence} input formats with SignerInfo structure inside * </ul> * * @param o the object we want converted. @@ -75,6 +113,16 @@ public class SignerInfo throw new IllegalArgumentException("unknown object in factory: " + o.getClass().getName()); } + /** + * + * @param sid + * @param digAlgorithm CMS knows as 'digestAlgorithm' + * @param authenticatedAttributes CMS knows as 'signedAttrs' + * @param digEncryptionAlgorithm CMS knows as 'signatureAlgorithm' + * @param encryptedDigest CMS knows as 'signature' + * @param unauthenticatedAttributes CMS knows as 'unsignedAttrs' + */ + public SignerInfo( SignerIdentifier sid, AlgorithmIdentifier digAlgorithm, @@ -100,6 +148,15 @@ public class SignerInfo this.unauthenticatedAttributes = unauthenticatedAttributes; } + /** + * + * @param sid + * @param digAlgorithm CMS knows as 'digestAlgorithm' + * @param authenticatedAttributes CMS knows as 'signedAttrs' + * @param digEncryptionAlgorithm CMS knows as 'signatureAlgorithm' + * @param encryptedDigest CMS knows as 'signature' + * @param unauthenticatedAttributes CMS knows as 'unsignedAttrs' + */ public SignerInfo( SignerIdentifier sid, AlgorithmIdentifier digAlgorithm, diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/Time.java b/core/src/main/java/org/bouncycastle/asn1/cms/Time.java index ad008a1b..627569dd 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/Time.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/Time.java @@ -14,11 +14,19 @@ import org.bouncycastle.asn1.DERUTCTime; /** * <a href="http://tools.ietf.org/html/rfc5652#section-11.3">RFC 5652</a>: + * Dual-mode timestamp format producing either UTCTIme or GeneralizedTime. + * <p> * <pre> * Time ::= CHOICE { * utcTime UTCTime, * generalTime GeneralizedTime } * </pre> + * <p> + * This has a constructor using java.util.Date for input which generates + * a {@link org.bouncycastle.asn1.DERUTCTime DERUTCTime} object if the + * supplied datetime is in range 1950-01-01-00:00:00 UTC to 2049-12-31-23:59:60 UTC. + * If the datetime value is outside that range, the generated object will be + * {@link org.bouncycastle.asn1.DERGeneralizedTime DERGeneralizedTime}. */ public class Time extends ASN1Object @@ -46,7 +54,7 @@ public class Time } /** - * creates a time object from a given date - if the date is between 1950 + * Creates a time object from a given date - if the date is between 1950 * and 2049 a UTCTime object is generated, otherwise a GeneralizedTime * is used. */ @@ -72,11 +80,11 @@ public class Time } /** - * return a Time object from the given object. + * Return a Time object from the given object. * <p> * Accepted inputs: * <ul> - * <li> null -> null + * <li> null → null * <li> {@link Time} object * <li> {@link org.bouncycastle.asn1.DERUTCTime DERUTCTime} object * <li> {@link org.bouncycastle.asn1.DERGeneralizedTime DERGeneralizedTime} object diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/TimeStampAndCRL.java b/core/src/main/java/org/bouncycastle/asn1/cms/TimeStampAndCRL.java index 38b9870d..f6d8d5a0 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/TimeStampAndCRL.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/TimeStampAndCRL.java @@ -9,6 +9,7 @@ import org.bouncycastle.asn1.x509.CertificateList; /** * <a href="http://tools.ietf.org/html/rfc5544">RFC 5544</a> + * Binding Documents with Time-Stamps; TimeStampAndCRL object. * <pre> * TimeStampAndCRL ::= SEQUENCE { * timeStamp TimeStampToken, -- according to RFC 3161 @@ -37,25 +38,30 @@ public class TimeStampAndCRL } /** - * return a TimeStampAndCRL object from the given object. + * Return a TimeStampAndCRL object from the given object. * <p> * Accepted inputs: * <ul> - * <li> null -> null + * <li> null → null * <li> {@link TimeStampAndCRL} object - * <li> {@link org.bouncycastle.asn1.ASN1Sequence ASN1Sequence} input formats with TimeStampAndCRL structure inside + * <li> {@link org.bouncycastle.asn1.ASN1Sequence#getInstance(java.lang.Object) ASN1Sequence} input formats with TimeStampAndCRL structure inside * </ul> * - * @param _obj the object we want converted. + * @param obj the object we want converted. * @exception IllegalArgumentException if the object cannot be converted. */ public static TimeStampAndCRL getInstance(Object obj) { - if (obj == null || obj instanceof TimeStampAndCRL) + if (obj instanceof TimeStampAndCRL) { return (TimeStampAndCRL)obj; } - return new TimeStampAndCRL(ASN1Sequence.getInstance(obj)); + else if (obj != null) + { + return new TimeStampAndCRL(ASN1Sequence.getInstance(obj)); + } + + return null; } public ContentInfo getTimeStampToken() diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/TimeStampTokenEvidence.java b/core/src/main/java/org/bouncycastle/asn1/cms/TimeStampTokenEvidence.java index 91058111..5461147b 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/TimeStampTokenEvidence.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/TimeStampTokenEvidence.java @@ -11,6 +11,7 @@ import org.bouncycastle.asn1.DERSequence; /** * <a href="http://tools.ietf.org/html/rfc5544">RFC 5544</a> + * Binding Documents with Time-Stamps; TimeStampTokenEvidence object. * <pre> * TimeStampTokenEvidence ::= * SEQUENCE SIZE(1..MAX) OF TimeStampAndCRL @@ -51,13 +52,13 @@ public class TimeStampTokenEvidence } /** - * return a TimeStampTokenEvidence object from the given object. + * Return a TimeStampTokenEvidence object from the given object. * <p> * Accepted inputs: * <ul> - * <li> null -> null + * <li> null → null * <li> {@link TimeStampTokenEvidence} object - * <li> {@link org.bouncycastle.asn1.ASN1Sequence ASN1Sequence} input formats with TimeStampTokenEvidence structure inside + * <li> {@link org.bouncycastle.asn1.ASN1Sequence#getInstance(java.lang.Object) ASN1Sequence} input formats with TimeStampTokenEvidence structure inside * </ul> * * @param obj the object we want converted. @@ -65,11 +66,16 @@ public class TimeStampTokenEvidence */ public static TimeStampTokenEvidence getInstance(Object obj) { - if (obj == null || obj instanceof TimeStampTokenEvidence) + if (obj instanceof TimeStampTokenEvidence) { return (TimeStampTokenEvidence)obj; } - return new TimeStampTokenEvidence(ASN1Sequence.getInstance(obj)); + else if (obj != null) + { + return new TimeStampTokenEvidence(ASN1Sequence.getInstance(obj)); + } + + return null; } public TimeStampAndCRL[] toTimeStampAndCRLArray() diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/TimeStampedData.java b/core/src/main/java/org/bouncycastle/asn1/cms/TimeStampedData.java index 9e27ce8d..d3d96d3e 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/TimeStampedData.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/TimeStampedData.java @@ -11,6 +11,8 @@ import org.bouncycastle.asn1.DERIA5String; /** * <a href="http://tools.ietf.org/html/rfc5544">RFC 5544</a>: + * Binding Documents with Time-Stamps; TimeStampedData object. + * <p> * <pre> * TimeStampedData ::= SEQUENCE { * version INTEGER { v1(1) }, @@ -60,13 +62,13 @@ public class TimeStampedData } /** - * return a TimeStampedData object from the given object. + * Return a TimeStampedData object from the given object. * <p> * Accepted inputs: * <ul> - * <li> null -> null + * <li> null → null * <li> {@link RecipientKeyIdentifier} object - * <li> {@link org.bouncycastle.asn1.ASN1Sequence ASN1Sequence} input formats with TimeStampedData structure inside + * <li> {@link org.bouncycastle.asn1.ASN1Sequence#getInstance(java.lang.Object) ASN1Sequence} input formats with TimeStampedData structure inside * </ul> * * @param _obj the object we want converted. diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/TimeStampedDataParser.java b/core/src/main/java/org/bouncycastle/asn1/cms/TimeStampedDataParser.java index 0d050eb8..173e094d 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/TimeStampedDataParser.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/TimeStampedDataParser.java @@ -12,6 +12,22 @@ import org.bouncycastle.asn1.ASN1SequenceParser; import org.bouncycastle.asn1.BERSequence; import org.bouncycastle.asn1.DERIA5String; + +/** + * Parser for <a href="http://tools.ietf.org/html/rfc5544">RFC 5544</a>: + * {@link TimeStampedData} object. + * <p> + * <pre> + * TimeStampedData ::= SEQUENCE { + * version INTEGER { v1(1) }, + * dataUri IA5String OPTIONAL, + * metaData MetaData OPTIONAL, + * content OCTET STRING OPTIONAL, + * temporalEvidence Evidence + * } + * </pre> + */ + public class TimeStampedDataParser { private ASN1Integer version; diff --git a/core/src/main/java/org/bouncycastle/asn1/cms/ecc/MQVuserKeyingMaterial.java b/core/src/main/java/org/bouncycastle/asn1/cms/ecc/MQVuserKeyingMaterial.java index a4f45eb8..aa5a4421 100644 --- a/core/src/main/java/org/bouncycastle/asn1/cms/ecc/MQVuserKeyingMaterial.java +++ b/core/src/main/java/org/bouncycastle/asn1/cms/ecc/MQVuserKeyingMaterial.java @@ -9,7 +9,9 @@ import org.bouncycastle.asn1.ASN1TaggedObject; import org.bouncycastle.asn1.DERSequence; import org.bouncycastle.asn1.DERTaggedObject; import org.bouncycastle.asn1.cms.OriginatorPublicKey; + /** + * <a href="http://tools.ietf.org/html/rfc5753">RFC 5753/3278</a>: MQVuserKeyingMaterial object. * <pre> * MQVuserKeyingMaterial ::= SEQUENCE { * ephemeralPublicKey OriginatorPublicKey, |