Class SignerIdentifier

  • All Implemented Interfaces:
    ASN1Value

    public class SignerIdentifier
    extends java.lang.Object
    implements ASN1Value
    CMS SignerIdentifier:
     SignerIdentifier ::= CHOICE {
          issuerAndSerialNumber IssuerAndSerialNumber,
          subjectKeyIdentifier [0] SubjectKeyIdentifier }
     
    • Method Detail

      • getType

        public SignerIdentifier.Type getType()
        Returns the type of SignerIdentifier:
        • ISSUER_AND_SERIALNUMBER
        • SUBJECT_KEY_IDENTIFIER
      • getIssuerAndSerialNumber

        public IssuerAndSerialNumber getIssuerAndSerialNumber()
        If type == ISSUER_AND_SERIALNUMBER, returns the IssuerAndSerialNumber field. Otherwise, returns null.
      • getSubjectKeyIdentifier

        public OCTET_STRING getSubjectKeyIdentifier()
        If type == SUBJECT_KEY_IDENTIFIER, returns the SubjectKeyIdentifier field. Otherwise, returns null.
      • createIssuerAndSerialNumber

        public static SignerIdentifier createIssuerAndSerialNumber​(IssuerAndSerialNumber ias)
        Creates a new SignerIdentifier with the given IssuerAndSerialNumber field.
      • createSubjectKeyIdentifier

        public static SignerIdentifier createSubjectKeyIdentifier​(OCTET_STRING ski)
        Creates a new SignerIdentifier with the given SubjectKeyIdentifier field.
      • getTag

        public Tag getTag()
        Description copied from interface: ASN1Value
        Returns the base tag for this type, not counting any tags that may be imposed on it by its context.
        Specified by:
        getTag in interface ASN1Value
        Returns:
        Base tag.
      • encode

        public void encode​(java.io.OutputStream ostream)
                    throws java.io.IOException
        Description copied from interface: ASN1Value
        Write this value's DER encoding to an output stream using its own base tag.
        Specified by:
        encode in interface ASN1Value
        Parameters:
        ostream - Output stream.
        Throws:
        java.io.IOException - If an error occurred.
      • encode

        public void encode​(Tag implicitTag,
                           java.io.OutputStream ostream)
                    throws java.io.IOException
        Description copied from interface: ASN1Value
        Write this value's DER encoding to an output stream using an implicit tag.
        Specified by:
        encode in interface ASN1Value
        Parameters:
        implicitTag - Implicit tag.
        ostream - Output stream.
        Throws:
        java.io.IOException - If an error occurred.