public class ExtendedKeyUsageExtension extends Extension
id-ce-extKeyUsage OBJECT IDENTIFIER ::= {id-ce 37}
ExtKeyUsageSyntax ::= SEQUENCE SIZE (1..MAX) OF KeyPurposeId
KeyPurposeId ::= OBJECT IDENTIFIER
Key purposes may be defined by any organization with a need. Object identifiers used to identify key purposes shall be assigned in accordance with IANA or ITU-T Rec. X.660 | ISO/IEC/ITU 9834-1.
This extension may, at the option of the certificate issuer, be either critical or non-critical.
If the extension is flagged critical, then the certificate MUST be used only for one of the purposes indicated.
If the extension is flagged non-critical, then it indicates the intended purpose or purposes of the key, and may be used in finding the correct key/certificate of an entity that has multiple keys/certificates. It is an advisory field and does not imply that usage of the key is restricted by the certification authority to the purpose indicated. Certificate using applications may nevertheless require that a particular purpose be indicated in order for the certificate to be acceptable to that application.
If a certificate contains both a critical key usage field and a critical extended key usage field, then both fields MUST be processed independently and the certificate MUST only be used for a purpose consistent with both fields. If there is no purpose consistent with both fields, then the certificate MUST NOT be used for any purpose.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
NAME |
critical, extensionId, extensionValue| Constructor and Description |
|---|
ExtendedKeyUsageExtension(java.lang.Boolean critical,
java.lang.Object value)
Create the extension from its DER encoded value and criticality.
|
ExtendedKeyUsageExtension(java.lang.Boolean critical,
java.util.Vector<com.tencent.kona.sun.security.util.ObjectIdentifier> keyUsages)
Create a ExtendedKeyUsageExtension object from
a Vector of KeyUsages with specified criticality.
|
ExtendedKeyUsageExtension(java.util.Vector<com.tencent.kona.sun.security.util.ObjectIdentifier> keyUsages)
Create a ExtendedKeyUsageExtension object from
a Vector of Key Usages; the criticality is set to false.
|
| Modifier and Type | Method and Description |
|---|---|
void |
encode(com.tencent.kona.sun.security.util.DerOutputStream out)
Write the extension to the DerOutputStream.
|
java.util.List<java.lang.String> |
getExtendedKeyUsage() |
java.lang.String |
getName()
Return the name of this extension.
|
java.util.Vector<com.tencent.kona.sun.security.util.ObjectIdentifier> |
getUsages()
Get the keyUsages value.
|
java.lang.String |
toString()
Return the extension as user readable string.
|
encode, equals, getExtensionId, getExtensionValue, getId, getValue, hashCode, isCritical, newExtensionpublic static final java.lang.String NAME
public ExtendedKeyUsageExtension(java.util.Vector<com.tencent.kona.sun.security.util.ObjectIdentifier> keyUsages)
keyUsages - the Vector of KeyUsages (ObjectIdentifiers)public ExtendedKeyUsageExtension(java.lang.Boolean critical,
java.util.Vector<com.tencent.kona.sun.security.util.ObjectIdentifier> keyUsages)
critical - true if the extension is to be treated as critical.keyUsages - the Vector of KeyUsages (ObjectIdentifiers),
cannot be null or empty.public ExtendedKeyUsageExtension(java.lang.Boolean critical,
java.lang.Object value)
throws java.io.IOException
critical - true if the extension is to be treated as critical.value - an array of DER encoded bytes of the actual value.java.lang.ClassCastException - if value is not an array of bytesjava.io.IOException - on error.public java.lang.String toString()
public void encode(com.tencent.kona.sun.security.util.DerOutputStream out)
public java.util.Vector<com.tencent.kona.sun.security.util.ObjectIdentifier> getUsages()
public java.lang.String getName()
public java.util.List<java.lang.String> getExtendedKeyUsage()