Class ExtendedKeyUsage

  • All Implemented Interfaces:
    ASN1Encodable, Encodable

    public class ExtendedKeyUsage
    extends ASN1Object
    The extendedKeyUsage object.
          extendedKeyUsage ::= SEQUENCE SIZE (1..MAX) OF KeyPurposeId
     
    • Constructor Detail

      • ExtendedKeyUsage

        public ExtendedKeyUsage​(KeyPurposeId usage)
        Base constructor, from a single KeyPurposeId.
        Parameters:
        usage - the keyPurposeId to be included.
      • ExtendedKeyUsage

        public ExtendedKeyUsage​(KeyPurposeId[] usages)
        Base constructor, from multiple KeyPurposeIds.
        Parameters:
        usages - an array of KeyPurposeIds.
      • ExtendedKeyUsage

        public ExtendedKeyUsage​(java.util.Vector usages)
        Deprecated.
        use KeyPurposeId[] constructor.
    • Method Detail

      • getInstance

        public static ExtendedKeyUsage getInstance​(ASN1TaggedObject obj,
                                                   boolean explicit)
        Return an ExtendedKeyUsage from the passed in tagged object.
        Parameters:
        obj - the tagged object containing the ExtendedKeyUsage
        explicit - true if the tagged object should be interpreted as explicitly tagged, false if implicit.
        Returns:
        the ExtendedKeyUsage contained.
      • getInstance

        public static ExtendedKeyUsage getInstance​(java.lang.Object obj)
        Return an ExtendedKeyUsage from the passed in object.
        Parameters:
        obj - an ExtendedKeyUsage, some form or encoding of one, or null.
        Returns:
        an ExtendedKeyUsage object, or null if null is passed in.
      • fromExtensions

        public static ExtendedKeyUsage fromExtensions​(Extensions extensions)
        Retrieve an ExtendedKeyUsage for a passed in Extensions object, if present.
        Parameters:
        extensions - the extensions object to be examined.
        Returns:
        the ExtendedKeyUsage, null if the extension is not present.
      • hasKeyPurposeId

        public boolean hasKeyPurposeId​(KeyPurposeId keyPurposeId)
        Return true if this ExtendedKeyUsage object contains the passed in keyPurposeId.
        Parameters:
        keyPurposeId - the KeyPurposeId of interest.
        Returns:
        true if the keyPurposeId is present, false otherwise.
      • getUsages

        public KeyPurposeId[] getUsages()
        Returns all extended key usages.
        Returns:
        An array with all key purposes.
      • size

        public int size()
        Return the number of KeyPurposeIds present in this ExtendedKeyUsage.
        Returns:
        the number of KeyPurposeIds