Class CertificateVersion
java.lang.Object
org.mozilla.jss.netscape.security.x509.CertificateVersion
- All Implemented Interfaces:
CertAttrSet
This class defines the version of the X509 Certificate.
- Version:
- 1.8
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringIdentifier for this attribute, to be used with the get, set, delete methods of Certificate, x509 type.static final StringSub attributes name for this CertAttrSet.static final intX509Certificate Version 1static final intX509Certificate Version 2static final intX509Certificate Version 3(package private) intstatic final String -
Constructor Summary
ConstructorsConstructorDescriptionThe default constructor for this class, sets the version to 0 (i.e.CertificateVersion(int version) The constructor for this class for the required version.Create the object, decoding the values from the passed stream.Create the object, decoding the values from the passed DER stream.Create the object, decoding the values from the passed DerValue. -
Method Summary
Modifier and TypeMethodDescriptionintcompare(int vers) Compare versions.private voidvoiddecode(InputStream in) Decode the CertificateVersion period in DER form from the stream.voidDelete the attribute value.voidencode(OutputStream out) Encode the CertificateVersion period in DER form to the stream.Get the attribute value.Return an enumeration of names of attributes existing within this attribute.getName()Return the name of this attribute.private intvoidSet the attribute value.toString()Return the version number of the certificate.
-
Field Details
-
V1
public static final int V1X509Certificate Version 1- See Also:
-
V2
public static final int V2X509Certificate Version 2- See Also:
-
V3
public static final int V3X509Certificate Version 3- See Also:
-
IDENT
Identifier for this attribute, to be used with the get, set, delete methods of Certificate, x509 type.- See Also:
-
NAME
Sub attributes name for this CertAttrSet.- See Also:
-
VERSION
- See Also:
-
version
int version
-
-
Constructor Details
-
CertificateVersion
public CertificateVersion()The default constructor for this class, sets the version to 0 (i.e. X.509 version 1). -
CertificateVersion
The constructor for this class for the required version.- Parameters:
version- the version for the certificate.- Throws:
IOException- if the version is not valid.
-
CertificateVersion
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.
-
CertificateVersion
Create the object, decoding the values from the passed stream.- Parameters:
in- the InputStream to read the CertificateVersion from.- Throws:
IOException- on decoding errors.
-
CertificateVersion
Create the object, decoding the values from the passed DerValue.- Parameters:
val- the Der encoded value.- Throws:
IOException- on decoding errors.
-
-
Method Details
-
getVersion
private int getVersion() -
construct
- Throws:
IOException
-
toString
Return the version number of the certificate.- Specified by:
toStringin interfaceCertAttrSet- Overrides:
toStringin classObject- Returns:
- value of this certificate attribute in printable form.
-
encode
Encode the CertificateVersion period in DER form to the stream.- Specified by:
encodein interfaceCertAttrSet- Parameters:
out- the OutputStream to marshal the contents to.- Throws:
IOException- on errors.
-
decode
Decode the CertificateVersion period in DER form from the stream.- Specified by:
decodein interfaceCertAttrSet- Parameters:
in- the InputStream to unmarshal the contents from.- Throws:
IOException- on errors.
-
set
Set the attribute value.- Specified by:
setin interfaceCertAttrSet- Parameters:
name- the name of the attribute (e.g. "x509.info.key")obj- the attribute object.- Throws:
IOException- on other errors.
-
get
Get the attribute value.- Specified by:
getin interfaceCertAttrSet- Parameters:
name- the name of the attribute to return.- Returns:
- attribute value
- Throws:
IOException- on other errors.
-
delete
Delete the attribute value.- Specified by:
deletein interfaceCertAttrSet- Parameters:
name- the name of the attribute to delete.- Throws:
IOException- on other errors.
-
getAttributeNames
Return an enumeration of names of attributes existing within this attribute.- Specified by:
getAttributeNamesin interfaceCertAttrSet- Returns:
- an enumeration of the attribute names.
-
getName
Return the name of this attribute.- Specified by:
getNamein interfaceCertAttrSet- Returns:
- the name of this CertAttrSet.
-
compare
public int compare(int vers) Compare versions.
-