Class AuthenticatedData

  • All Implemented Interfaces:
    ASN1Encodable, Encodable

    public class AuthenticatedData
    extends ASN1Object
    RFC 5652 section 9.1: The AuthenticatedData carries AuthAttributes and other data which define what really is being signed.
     AuthenticatedData ::= SEQUENCE {
           version CMSVersion,
           originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL,
           recipientInfos RecipientInfos,
           macAlgorithm MessageAuthenticationCodeAlgorithm,
           digestAlgorithm [1] DigestAlgorithmIdentifier OPTIONAL,
           encapContentInfo EncapsulatedContentInfo,
           authAttrs [2] IMPLICIT AuthAttributes OPTIONAL,
           mac MessageAuthenticationCode,
           unauthAttrs [3] IMPLICIT UnauthAttributes OPTIONAL }
    
     AuthAttributes ::= SET SIZE (1..MAX) OF Attribute
    
     UnauthAttributes ::= SET SIZE (1..MAX) OF Attribute
    
     MessageAuthenticationCode ::= OCTET STRING
     
    • Method Detail

      • getInstance

        public static AuthenticatedData getInstance​(ASN1TaggedObject obj,
                                                    boolean explicit)
        Return an AuthenticatedData object from a tagged object.
        Parameters:
        obj - the tagged object holding the object we want.
        explicit - true if the object is meant to be explicitly tagged false otherwise.
        Returns:
        a reference that can be assigned to AuthenticatedData (may be null)
        Throws:
        java.lang.IllegalArgumentException - if the object held by the tagged object cannot be converted.
      • getInstance

        public static AuthenticatedData getInstance​(java.lang.Object obj)
        Return an AuthenticatedData object from the given object.

        Accepted inputs:

        Parameters:
        obj - the object we want converted.
        Returns:
        a reference that can be assigned to AuthenticatedData (may be null)
        Throws:
        java.lang.IllegalArgumentException - if the object cannot be converted.
      • getRecipientInfos

        public ASN1Set getRecipientInfos()
      • getEncapsulatedContentInfo

        public ContentInfo getEncapsulatedContentInfo()
      • getAuthAttrs

        public ASN1Set getAuthAttrs()
      • getUnauthAttrs

        public ASN1Set getUnauthAttrs()
      • calculateVersion

        public static int calculateVersion​(OriginatorInfo origInfo)