Package org.bouncycastle.asn1.x509
Class ExtendedKeyUsage
java.lang.Object
org.bouncycastle.asn1.ASN1Object
org.bouncycastle.asn1.x509.ExtendedKeyUsage
- All Implemented Interfaces:
ASN1Encodable
,Encodable
The extendedKeyUsage object.
extendedKeyUsage ::= SEQUENCE SIZE (1..MAX) OF KeyPurposeId
-
Constructor Summary
ConstructorDescriptionExtendedKeyUsage
(Vector usages) Deprecated.use KeyPurposeId[] constructor.ExtendedKeyUsage
(KeyPurposeId usage) Base constructor, from a single KeyPurposeId.ExtendedKeyUsage
(KeyPurposeId[] usages) Base constructor, from multiple KeyPurposeIds. -
Method Summary
Modifier and TypeMethodDescriptionstatic ExtendedKeyUsage
fromExtensions
(Extensions extensions) Retrieve an ExtendedKeyUsage for a passed in Extensions object, if present.static ExtendedKeyUsage
getInstance
(Object obj) Return an ExtendedKeyUsage from the passed in object.static ExtendedKeyUsage
getInstance
(ASN1TaggedObject obj, boolean explicit) Return an ExtendedKeyUsage from the passed in tagged object.Returns all extended key usages.boolean
hasKeyPurposeId
(KeyPurposeId keyPurposeId) Return true if this ExtendedKeyUsage object contains the passed in keyPurposeId.int
size()
Return the number of KeyPurposeIds present in this ExtendedKeyUsage.Return the ASN.1 primitive form of this object.Methods inherited from class org.bouncycastle.asn1.ASN1Object
encodeTo, encodeTo, equals, getEncoded, getEncoded, hasEncodedTagValue, hashCode
-
Constructor Details
-
ExtendedKeyUsage
Base constructor, from a single KeyPurposeId.- Parameters:
usage
- the keyPurposeId to be included.
-
ExtendedKeyUsage
Base constructor, from multiple KeyPurposeIds.- Parameters:
usages
- an array of KeyPurposeIds.
-
ExtendedKeyUsage
Deprecated.use KeyPurposeId[] constructor.
-
-
Method Details
-
getInstance
Return an ExtendedKeyUsage from the passed in tagged object.- Parameters:
obj
- the tagged object containing the ExtendedKeyUsageexplicit
- true if the tagged object should be interpreted as explicitly tagged, false if implicit.- Returns:
- the ExtendedKeyUsage contained.
-
getInstance
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
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
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
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
-
toASN1Primitive
Return the ASN.1 primitive form of this object.- Specified by:
toASN1Primitive
in interfaceASN1Encodable
- Specified by:
toASN1Primitive
in classASN1Object
- Returns:
- an ASN1Sequence.
-