public class CertificateVersion extends java.lang.Object implements CertAttrSet
CertAttrSet
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
IDENT
Identifier for this attribute, to be used with the
get, set, delete methods of Certificate, x509 type.
|
static java.lang.String |
NAME
Sub attributes name for this CertAttrSet.
|
static int |
V1
X509Certificate Version 1
|
static int |
V2
X509Certificate Version 2
|
static int |
V3
X509Certificate Version 3
|
static java.lang.String |
VERSION |
Constructor and Description |
---|
CertificateVersion()
The default constructor for this class,
sets the version to 0 (i.e.
|
CertificateVersion(DerInputStream in)
Create the object, decoding the values from the passed DER stream.
|
CertificateVersion(DerValue val)
Create the object, decoding the values from the passed DerValue.
|
CertificateVersion(java.io.InputStream in)
Create the object, decoding the values from the passed stream.
|
CertificateVersion(int version)
The constructor for this class for the required version.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(int vers)
Compare versions.
|
void |
decode(java.io.InputStream in)
Decode the CertificateVersion period in DER form from the stream.
|
void |
delete(java.lang.String name)
Delete the attribute value.
|
void |
encode(java.io.OutputStream out)
Encode the CertificateVersion period in DER form to the stream.
|
java.lang.Object |
get(java.lang.String name)
Get the attribute value.
|
java.util.Enumeration<java.lang.String> |
getAttributeNames()
Return an enumeration of names of attributes existing within this
attribute.
|
java.lang.String |
getName()
Return the name of this attribute.
|
void |
set(java.lang.String name,
java.lang.Object obj)
Set the attribute value.
|
java.lang.String |
toString()
Return the version number of the certificate.
|
public static final int V1
public static final int V2
public static final int V3
public static final java.lang.String IDENT
public static final java.lang.String NAME
public static final java.lang.String VERSION
public CertificateVersion()
public CertificateVersion(int version) throws java.io.IOException
version
- the version for the certificate.java.io.IOException
- if the version is not valid.public CertificateVersion(DerInputStream in) throws java.io.IOException
in
- the DerInputStream to read the CertificateVersion from.java.io.IOException
- on decoding errors.public CertificateVersion(java.io.InputStream in) throws java.io.IOException
in
- the InputStream to read the CertificateVersion from.java.io.IOException
- on decoding errors.public CertificateVersion(DerValue val) throws java.io.IOException
val
- the Der encoded value.java.io.IOException
- on decoding errors.public java.lang.String toString()
toString
in interface CertAttrSet
toString
in class java.lang.Object
public void encode(java.io.OutputStream out) throws java.io.IOException
encode
in interface CertAttrSet
out
- the OutputStream to marshal the contents to.java.io.IOException
- on errors.public void decode(java.io.InputStream in) throws java.io.IOException
decode
in interface CertAttrSet
in
- the InputStream to unmarshal the contents from.java.io.IOException
- on errors.public void set(java.lang.String name, java.lang.Object obj) throws java.io.IOException
set
in interface CertAttrSet
name
- the name of the attribute (e.g. "x509.info.key")obj
- the attribute object.java.io.IOException
- on other errors.public java.lang.Object get(java.lang.String name) throws java.io.IOException
get
in interface CertAttrSet
name
- the name of the attribute to return.java.io.IOException
- on other errors.public void delete(java.lang.String name) throws java.io.IOException
delete
in interface CertAttrSet
name
- the name of the attribute to delete.java.io.IOException
- on other errors.public java.util.Enumeration<java.lang.String> getAttributeNames()
getAttributeNames
in interface CertAttrSet
public java.lang.String getName()
getName
in interface CertAttrSet
public int compare(int vers)