Top Description Fields Constructors Methods
org.bouncycastle.asn1.x509

public Class ExtendedKeyUsage

extends ASN1Object
Class Inheritance
Imports
java.util.Enumeration, .Hashtable, .Vector, org.bouncycastle.asn1.ASN1Encodable, .ASN1EncodableVector, .ASN1Object, .ASN1ObjectIdentifier, .ASN1Primitive, .ASN1Sequence, .ASN1TaggedObject, .DERSequence

The extendedKeyUsage object.
     extendedKeyUsage ::= SEQUENCE SIZE (1..MAX) OF KeyPurposeId

Field Summary

Modifier and TypeField and Description
pack-priv ASN1Sequence
pack-priv Hashtable<K, V>

Constructor Summary

AccessConstructor and Description
public
ExtendedKeyUsage(KeyPurposeId
the keyPurposeId to be included.
usage
)

Base constructor, from a single KeyPurposeId.

private
public
ExtendedKeyUsage(KeyPurposeId[]
an array of KeyPurposeIds.
usages
)

Base constructor, from multiple KeyPurposeIds.

public
ExtendedKeyUsage(Vector<E> usages)

Deprecated use KeyPurposeId[] constructor.

Method Summary

Modifier and TypeMethod and Description
public static ExtendedKeyUsage

Returns:

the ExtendedKeyUsage, null if the extension is not present.
fromExtensions
(Extensions
the extensions object to be examined.
extensions
)

Retrieve an ExtendedKeyUsage for a passed in Extensions object, if present.

public static ExtendedKeyUsage

Returns:

the ExtendedKeyUsage contained.
getInstance
(ASN1TaggedObject
the tagged object containing the ExtendedKeyUsage
obj
,
boolean
true if the tagged object should be interpreted as explicitly tagged, false if implicit.
explicit
)

Return an ExtendedKeyUsage from the passed in tagged object.

public static ExtendedKeyUsage

Returns:

an ExtendedKeyUsage object, or null if null is passed in.
getInstance
(Object
an ExtendedKeyUsage, some form or encoding of one, or null.
obj
)

Return an ExtendedKeyUsage from the passed in object.

public KeyPurposeId[]

Returns:

An array with all key purposes.
getUsages
()

Returns all extended key usages.

public boolean

Returns:

true if the keyPurposeId is present, false otherwise.
hasKeyPurposeId
(KeyPurposeId
the KeyPurposeId of interest.
keyPurposeId
)

Return true if this ExtendedKeyUsage object contains the passed in keyPurposeId.

public int

Returns:

the number of KeyPurposeIds
size
()

Return the number of KeyPurposeIds present in this ExtendedKeyUsage.

public ASN1Primitive

Returns:

an ASN1Sequence.
toASN1Primitive
()

Implements abstract org.bouncycastle.asn1.ASN1Object.toASN1Primitive.

Implements org.bouncycastle.asn1.ASN1Encodable.toASN1Primitive.

Return the ASN.1 primitive form of this object.
Inherited from org.bouncycastle.asn1.ASN1Object:
encodeToencodeToequalsgetEncodedgetEncodedhasEncodedTagValuehashCode

Field Detail

seqback to summary
pack-priv ASN1Sequence seq
usageTableback to summary
pack-priv Hashtable<K, V> usageTable

Constructor Detail

ExtendedKeyUsageback to summary
public ExtendedKeyUsage(KeyPurposeId usage)

Base constructor, from a single KeyPurposeId.

Parameters
usage:KeyPurposeId

the keyPurposeId to be included.

ExtendedKeyUsageback to summary
private ExtendedKeyUsage(ASN1Sequence seq)
ExtendedKeyUsageback to summary
public ExtendedKeyUsage(KeyPurposeId[] usages)

Base constructor, from multiple KeyPurposeIds.

Parameters
usages:KeyPurposeId[]

an array of KeyPurposeIds.

ExtendedKeyUsageback to summary
public ExtendedKeyUsage(Vector<E> usages)

Deprecated

use KeyPurposeId[] constructor.

Method Detail

fromExtensionsback to summary
public static ExtendedKeyUsage fromExtensions(Extensions extensions)

Retrieve an ExtendedKeyUsage for a passed in Extensions object, if present.

Parameters
extensions:Extensions

the extensions object to be examined.

Returns:ExtendedKeyUsage

the ExtendedKeyUsage, null if the extension is not present.

getInstanceback to summary
public static ExtendedKeyUsage getInstance(ASN1TaggedObject obj, boolean explicit)

Return an ExtendedKeyUsage from the passed in tagged object.

Parameters
obj:ASN1TaggedObject

the tagged object containing the ExtendedKeyUsage

explicit:boolean

true if the tagged object should be interpreted as explicitly tagged, false if implicit.

Returns:ExtendedKeyUsage

the ExtendedKeyUsage contained.

getInstanceback to summary
public static ExtendedKeyUsage getInstance(Object obj)

Return an ExtendedKeyUsage from the passed in object.

Parameters
obj:Object

an ExtendedKeyUsage, some form or encoding of one, or null.

Returns:ExtendedKeyUsage

an ExtendedKeyUsage object, or null if null is passed in.

getUsagesback to summary
public KeyPurposeId[] getUsages()

Returns all extended key usages.

Returns:KeyPurposeId[]

An array with all key purposes.

hasKeyPurposeIdback to summary
public boolean hasKeyPurposeId(KeyPurposeId keyPurposeId)

Return true if this ExtendedKeyUsage object contains the passed in keyPurposeId.

Parameters
keyPurposeId:KeyPurposeId

the KeyPurposeId of interest.

Returns:boolean

true if the keyPurposeId is present, false otherwise.

sizeback to summary
public int size()

Return the number of KeyPurposeIds present in this ExtendedKeyUsage.

Returns:int

the number of KeyPurposeIds

toASN1Primitiveback to summary
public ASN1Primitive toASN1Primitive()

Implements abstract org.bouncycastle.asn1.ASN1Object.toASN1Primitive.

Implements org.bouncycastle.asn1.ASN1Encodable.toASN1Primitive.

Return the ASN.1 primitive form of this object.

Returns:ASN1Primitive

an ASN1Sequence.