Class X509SubjectAltNameEvidenceDecoder

  • All Implemented Interfaces:
    Function<Evidence,​Principal>, EvidenceDecoder

    public final class X509SubjectAltNameEvidenceDecoder
    extends Object
    implements EvidenceDecoder
    An evidence decoder that derives the principal that should be associated with the given X509PeerCertificateChainEvidence from an X.509 subject alternative name from the first certificate in the given evidence.
    Since:
    1.10.0
    Author:
    Farah Juma
    • Field Detail

      • altNametype

        private final int altNametype
      • segment

        private final int segment
    • Constructor Detail

      • X509SubjectAltNameEvidenceDecoder

        public X509SubjectAltNameEvidenceDecoder​(int altNameType)
        Construct a new instance.
        Parameters:
        altNameType - the subject alternative name type to decode. Must be one of:
        • GeneralName.RFC_822_NAME
        • GeneralName.DNS_NAME
        • GeneralName.DIRECTORY_NAME
        • GeneralName.URI_NAME
        • GeneralName.IP_ADDRESS
        • GeneralName.REGISTERED_ID
      • X509SubjectAltNameEvidenceDecoder

        public X509SubjectAltNameEvidenceDecoder​(int altNameType,
                                                 int segment)
        Construct a new instance.
        Parameters:
        altNameType - the subject alternative name type to decode. Must be one of:
        • GeneralName.RFC_822_NAME
        • GeneralName.DNS_NAME
        • GeneralName.DIRECTORY_NAME
        • GeneralName.URI_NAME
        • GeneralName.IP_ADDRESS
        • GeneralName.REGISTERED_ID
        segment - the 0-based occurrence of the subject alternative name to map, used when there is more than one subject alternative name of the given altNameType
    • Method Detail

      • getPrincipal

        public Principal getPrincipal​(Evidence evidence)
        Description copied from interface: EvidenceDecoder
        Get the principal from the given evidence. If this decoder does not understand the given evidence, null is returned.
        Specified by:
        getPrincipal in interface EvidenceDecoder
        Parameters:
        evidence - the evidence to decode
        Returns:
        the principal, or null if this decoder does not understand the evidence