Oracle Security Developer Tools Security Engine Java API Reference
10g (10.1.4.0.1)

B28175-01


oracle.security.crypto.cert
Class X509Extension

java.lang.Object
  extended byoracle.security.crypto.cert.X509Extension

All Implemented Interfaces:
oracle.security.crypto.asn1.ASN1Object, oracle.security.crypto.util.Streamable
Direct Known Subclasses:
AuthorityInfoAccessExtension, AuthorityKeyIDExtension, BasicConstraintsExtension, CertificatePoliciesExtension, CRLCertificateIssuerExtension, CRLDistPointExtension, CRLHoldInstructionExtension, CRLInvalidityDateExtension, CRLNumberExtension, CRLReasonExtension, DeltaCRLIndicatorExtension, ExtKeyUsageExtension, IssuerAltNameExtension, IssuingDistPointExtension, KeyUsageExtension, NameConstraintsExtension, NetscapeCertTypeExtension, PolicyConstraintsExtension, SubjectAltNameExtension, SubjectKeyIDExtension

public class X509Extension
extends java.lang.Object
implements oracle.security.crypto.asn1.ASN1Object

An X.509 certificate or CRL extension.

An X.509 extensions consists of an ID which is an ASN.1 object identifier which indicates the type of the extension, together with a value, which is the DER encoding of an ASN.1 object, and a flag which indicates whether the extension is critical.

See Also:
X509, CRL

Field Summary
static oracle.security.crypto.asn1.ASN1ObjectID id_netscape_ce
          The Netscape certificate extensions OID prefix.
static oracle.security.crypto.asn1.ASN1ObjectID id_netscape_ce_type
          The Netscape certificate type extension OID.
static oracle.security.crypto.asn1.ASN1ObjectID id_set_ce
          The SET certificate extensions OID prefix.
static oracle.security.crypto.asn1.ASN1ObjectID id_set_ce_type
          The SET certificate type extension OID.
protected  boolean isDecoded
          For use by subclasses that decode the DER-encoded byte array value.

 

Constructor Summary
  X509Extension()
           
protected X509Extension(oracle.security.crypto.asn1.ASN1ObjectID type)
           
  X509Extension(oracle.security.crypto.asn1.ASN1ObjectID type, oracle.security.crypto.asn1.ASN1Object value)
          Creates a new X.509 extension with the given ID and value.
protected X509Extension(oracle.security.crypto.asn1.ASN1ObjectID type, boolean critical)
           
  X509Extension(oracle.security.crypto.asn1.ASN1ObjectID type, boolean critical, oracle.security.crypto.asn1.ASN1Object value)
          Creates a new X.509 extension with the given ID and value.
  X509Extension(oracle.security.crypto.asn1.ASN1ObjectID type, boolean critical, byte[] value)
          Creates a new X.509 extension with the given ID and value.
  X509Extension(oracle.security.crypto.asn1.ASN1ObjectID type, byte[] value)
          Creates a new X.509 extension with the given ID and value.
  X509Extension(oracle.security.crypto.asn1.ASN1Sequence s)
          Deprecated.  
  X509Extension(java.io.InputStream is)
          Creates a new X.509 extension by reading its encoding from the given input stream.

 

Method Summary
 oracle.security.crypto.asn1.ASN1Object getASN1Value()
          Deprecated. No replacement. This method will fail if the extension value is not an encoded ASN.1 object (e.g., OCSP Nonce extension).
 boolean getCritical()
          Indicates whether this extension is critical.
 oracle.security.crypto.asn1.ASN1ObjectID getID()
          Deprecated.  
 oracle.security.crypto.asn1.ASN1ObjectID getType()
           
 byte[] getValue()
          Returns the value of this extension.
 void input(oracle.security.crypto.asn1.ASN1Sequence s)
          Deprecated. use input(InputStream) instead.
 void input(java.io.InputStream is)
          Read from the specified input stream.
static X509Extension inputInstance(java.io.InputStream is)
          Instantiates a X509Extension or one of its sub-classes by reading its contents from the given input stream.
 boolean isRecognized()
          Returns true if this object's type is a recognized, specific sub-class of X509Extension, otherwise false.
 int length()
          Returns length of ASN.1 encoding.
 void output(java.io.OutputStream os)
          Output to the specified output stream.
protected  void setCritical(boolean critical)
          Sets if yes or not this extension is critical.
protected  void setValue(byte[] value)
          Sets the value of this extension.
 java.lang.String toString()
          Returns a string representation of this object.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Field Detail

id_netscape_ce

public static final oracle.security.crypto.asn1.ASN1ObjectID id_netscape_ce
The Netscape certificate extensions OID prefix.

id_netscape_ce_type

public static final oracle.security.crypto.asn1.ASN1ObjectID id_netscape_ce_type
The Netscape certificate type extension OID.

id_set_ce

public static final oracle.security.crypto.asn1.ASN1ObjectID id_set_ce
The SET certificate extensions OID prefix.

id_set_ce_type

public static final oracle.security.crypto.asn1.ASN1ObjectID id_set_ce_type
The SET certificate type extension OID.

isDecoded

protected boolean isDecoded
For use by subclasses that decode the DER-encoded byte array value. Should always be false for an instance of the X509Extension superclass.

Constructor Detail

X509Extension

public X509Extension()

X509Extension

protected X509Extension(oracle.security.crypto.asn1.ASN1ObjectID type)

X509Extension

protected X509Extension(oracle.security.crypto.asn1.ASN1ObjectID type,
                        boolean critical)

X509Extension

public X509Extension(oracle.security.crypto.asn1.ASN1ObjectID type,
                     byte[] value)
Creates a new X.509 extension with the given ID and value. The extension will not be marked critical.
Parameters:
type - The ID which identifies the type of the extension.
value - The value of this extension. This should be the DER encoding of an ASN.1 object.

X509Extension

public X509Extension(oracle.security.crypto.asn1.ASN1ObjectID type,
                     oracle.security.crypto.asn1.ASN1Object value)
Creates a new X.509 extension with the given ID and value. The extension will not be marked critical.
Parameters:
type - The ID which identifies the type of the extension.
value - The value of this extension.

X509Extension

public X509Extension(oracle.security.crypto.asn1.ASN1ObjectID type,
                     boolean critical,
                     byte[] value)
Creates a new X.509 extension with the given ID and value.
Parameters:
type - The ID which identifies the type of the extension.
critical - true if this extension is critical, otherwise false
value - The value of this extension. This should be the DER encoding of an ASN.1 object.

X509Extension

public X509Extension(oracle.security.crypto.asn1.ASN1ObjectID type,
                     boolean critical,
                     oracle.security.crypto.asn1.ASN1Object value)
Creates a new X.509 extension with the given ID and value.
Parameters:
type - The ID which identifies the type of the extension.
critical - true if this extension is critical, otherwise false
value - The value of this extension.

X509Extension

public X509Extension(java.io.InputStream is)
              throws java.io.IOException
Creates a new X.509 extension by reading its encoding from the given input stream.
Parameters:
is - the input stream

X509Extension

public X509Extension(oracle.security.crypto.asn1.ASN1Sequence s)
              throws java.io.IOException
Deprecated.  

Method Detail

inputInstance

public static X509Extension inputInstance(java.io.InputStream is)
                                   throws java.io.IOException
Instantiates a X509Extension or one of its sub-classes by reading its contents from the given input stream.
Parameters:
is - input stream containing the extension.
Returns:
returns an instance of the appropriate sub-class of X509Extension if the input extension's type/OID is known, otherwise returns an instance of X509Extension.
Throws:
java.io.IOException - if an error occurs reading from the input stream or instantiating the extension object.

isRecognized

public boolean isRecognized()
Returns true if this object's type is a recognized, specific sub-class of X509Extension, otherwise false.

getID

public oracle.security.crypto.asn1.ASN1ObjectID getID()
Deprecated.  
Returns the ASN.1 object identifier indicating the type of this extension.

getType

public oracle.security.crypto.asn1.ASN1ObjectID getType()

getCritical

public boolean getCritical()
Indicates whether this extension is critical.

setCritical

protected void setCritical(boolean critical)
Sets if yes or not this extension is critical.

getValue

public byte[] getValue()
Returns the value of this extension.

setValue

protected void setValue(byte[] value)
Sets the value of this extension.

getASN1Value

public oracle.security.crypto.asn1.ASN1Object getASN1Value()
                                                    throws java.io.IOException
Deprecated. No replacement. This method will fail if the extension value is not an encoded ASN.1 object (e.g., OCSP Nonce extension).
Returns the value of this extension as an ASN.1 object. That is, the value is interpreted as a DER encoding and parsed, yielding one of the built-in ASN.1 types.
Throws:
java.io.IOException

output

public void output(java.io.OutputStream os)
            throws java.io.IOException
Output to the specified output stream.
Specified by:
output in interface oracle.security.crypto.util.Streamable
Throws:
java.io.IOException

input

public void input(java.io.InputStream is)
           throws java.io.IOException
Read from the specified input stream.
Specified by:
input in interface oracle.security.crypto.util.Streamable
Throws:
java.io.IOException

input

public void input(oracle.security.crypto.asn1.ASN1Sequence s)
           throws java.io.IOException
Deprecated. use input(InputStream) instead.
Read in ASN.1 form.
Throws:
java.io.IOException

length

public int length()
Returns length of ASN.1 encoding.
Specified by:
length in interface oracle.security.crypto.util.Streamable

toString

public java.lang.String toString()
Returns a string representation of this object.
Returns:
a string representation

Oracle Security Developer Tools Security Engine Java API Reference
10g (10.1.4.0.1)

B28175-01


Copyright © 2005 ,2006 , Oracle. All rights reserved.