public class

CertificateVersion

extends Object
implements CertAttrSet<T>
java.lang.Object
   ↳ sun.security.x509.CertificateVersion

Class Overview

This class defines the version of the X509 Certificate.

See Also

Summary

Constants
String IDENT Identifier for this attribute, to be used with the get, set, delete methods of Certificate, x509 type.
String NAME Sub attributes name for this CertAttrSet.
int V1 X509Certificate Version 1
int V2 X509Certificate Version 2
int V3 X509Certificate Version 3
String VERSION
Public Constructors
CertificateVersion()
The default constructor for this class, sets the version to 0 (i.e.
CertificateVersion(int version)
The constructor for this class for the required version.
CertificateVersion(DerInputStream in)
Create the object, decoding the values from the passed DER stream.
CertificateVersion(InputStream in)
Create the object, decoding the values from the passed stream.
CertificateVersion(DerValue val)
Create the object, decoding the values from the passed DerValue.
Public Methods
int compare(int vers)
Compare versions.
void delete(String name)
Delete the attribute value.
void encode(OutputStream out)
Encode the CertificateVersion period in DER form to the stream.
Object get(String name)
Get the attribute value.
Enumeration<String> getElements()
Return an enumeration of names of attributes existing within this attribute.
String getName()
Return the name of this attribute.
void set(String name, Object obj)
Set the attribute value.
String toString()
Return the version number of the certificate.
[Expand]
Inherited Methods
From class java.lang.Object
From interface sun.security.x509.CertAttrSet

Constants

public static final String IDENT

Identifier for this attribute, to be used with the get, set, delete methods of Certificate, x509 type.

Constant Value: "x509.info.version"

public static final String NAME

Sub attributes name for this CertAttrSet.

Constant Value: "version"

public static final int V1

X509Certificate Version 1

Constant Value: 0 (0x00000000)

public static final int V2

X509Certificate Version 2

Constant Value: 1 (0x00000001)

public static final int V3

X509Certificate Version 3

Constant Value: 2 (0x00000002)

public static final String VERSION

Constant Value: "number"

Public Constructors

public CertificateVersion ()

The default constructor for this class, sets the version to 0 (i.e. X.509 version 1).

public CertificateVersion (int version)

The constructor for this class for the required version.

Parameters
version the version for the certificate.
Throws
IOException if the version is not valid.

public CertificateVersion (DerInputStream in)

Create the object, decoding the values from the passed DER stream.

Parameters
in the DerInputStream to read the CertificateVersion from.
Throws
IOException on decoding errors.

public CertificateVersion (InputStream in)

Create the object, decoding the values from the passed stream.

Parameters
in the InputStream to read the CertificateVersion from.
Throws
IOException on decoding errors.

public CertificateVersion (DerValue val)

Create the object, decoding the values from the passed DerValue.

Parameters
val the Der encoded value.
Throws
IOException on decoding errors.

Public Methods

public int compare (int vers)

Compare versions.

public void delete (String name)

Delete the attribute value.

Parameters
name the name of the attribute to delete.
Throws
IOException

public void encode (OutputStream out)

Encode the CertificateVersion period in DER form to the stream.

Parameters
out the OutputStream to marshal the contents to.
Throws
IOException on errors.

public Object get (String name)

Get the attribute value.

Parameters
name the name of the attribute to return.
Throws
IOException

public Enumeration<String> getElements ()

Return an enumeration of names of attributes existing within this attribute.

Returns
  • an enumeration of the attribute names.

public String getName ()

Return the name of this attribute.

Returns
  • the name of this CertAttrSet.

public void set (String name, Object obj)

Set the attribute value.

Parameters
name the name of the attribute (e.g. "x509.info.key")
obj the attribute object.
Throws
IOException

public String toString ()

Return the version number of the certificate.

Returns
  • a string representation of the object.