APIdia Launch Partner
Top Description Fields Constructors Methods
sun.security.x509

public Class CertificateVersion

extends Object
implements DerEncoder
Class Inheritance
All Implemented Interfaces
sun.security.util.DerEncoder
Imports
java.io.IOException, .InputStream, sun.security.util.*

This class defines the version of the X509 Certificate.
Authors
Amit Kapoor, Hemma Prafullchandra
See Also
DerEncoder

Field Summary

Modifier and TypeField and Description
public static final String
public static final int
V1

X509Certificate Version 1

public static final int
V2

X509Certificate Version 2

public static final int
V3

X509Certificate Version 3

pack-priv int

Constructor Summary

AccessConstructor and Description
public
CertificateVersion()

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

public
CertificateVersion(int
the version for the certificate.
version
)

The constructor for this class for the required version.

public
CertificateVersion(DerInputStream
the DerInputStream to read the CertificateVersion from.
in
)

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

public
CertificateVersion(InputStream
the InputStream to read the CertificateVersion from.
in
)

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

public
CertificateVersion(DerValue
the Der encoded value.
val
)

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

Method Summary

Modifier and TypeMethod and Description
public int
compare(int vers)

Compare versions.

private void
public void
encode(DerOutputStream
the DerOutputStream to marshal the contents to.
out
)

Implements sun.security.util.DerEncoder.encode.

Encode the CertificateVersion period in DER form to the stream.

public int
public String
toString()

Overrides java.lang.Object.toString.

Return the version number of the certificate.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

NAMEback to summary
public static final String NAME
V1back to summary
public static final int V1

X509Certificate Version 1

V2back to summary
public static final int V2

X509Certificate Version 2

V3back to summary
public static final int V3

X509Certificate Version 3

versionback to summary
pack-priv int version

Constructor Detail

CertificateVersionback to summary
public CertificateVersion()

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

CertificateVersionback to summary
public CertificateVersion(int version) throws IOException

The constructor for this class for the required version.

Parameters
version:int

the version for the certificate.

Exceptions
IOException:
if the version is not valid.
CertificateVersionback to summary
public CertificateVersion(DerInputStream in) throws IOException

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

Parameters
in:DerInputStream

the DerInputStream to read the CertificateVersion from.

Exceptions
IOException:
on decoding errors.
CertificateVersionback to summary
public CertificateVersion(InputStream in) throws IOException

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

Parameters
in:InputStream

the InputStream to read the CertificateVersion from.

Exceptions
IOException:
on decoding errors.
CertificateVersionback to summary
public CertificateVersion(DerValue val) throws IOException

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

Parameters
val:DerValue

the Der encoded value.

Exceptions
IOException:
on decoding errors.

Method Detail

compareback to summary
public int compare(int vers)

Compare versions.

constructback to summary
private void construct(DerValue derVal) throws IOException
encodeback to summary
public void encode(DerOutputStream out)

Implements sun.security.util.DerEncoder.encode.

Encode the CertificateVersion period in DER form to the stream.

Parameters
out:DerOutputStream

the DerOutputStream to marshal the contents to.

Annotations
@Override
getVersionback to summary
public int getVersion()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Return the version number of the certificate.