Class NSCertTypeExtension
java.lang.Object
org.mozilla.jss.netscape.security.x509.Extension
org.mozilla.jss.netscape.security.extensions.NSCertTypeExtension
- All Implemented Interfaces:
Serializable
,CertAttrSet
NSCertTypeExtension
Represents Netscape Certificate Type Extension
This deprecated extension, if present, defines both the purpose (e.g., encipherment, signature, certificate signing) and the application (e.g., SSL, S/Mime or Object Signing of the key contained in the certificate.
- Version:
- $Revision$, $Date$
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int[]
static final ObjectIdentifier
Identifies the particular public key used to sign the certificate.static final String
static final int
static final String
static final int
static final String
Identifier for this attribute, to be used with the get, set, delete methods of Certificate, x509 type.private byte[]
private static NSCertTypeExtension.MapEntry[]
static final String
Attribute names.static final int
static final String
static final int
static final String
static final int
private static final long
static final String
static final int
static final String
static final int
Attribute names.static final String
static final int
Fields inherited from class org.mozilla.jss.netscape.security.x509.Extension
critical, extensionId, extensionValue
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a default key usage.NSCertTypeExtension
(boolean[] bits) NSCertTypeExtension
(boolean critical, boolean[] bits) Create NSCertTypeExtension from boolean array.NSCertTypeExtension
(boolean critical, byte[] bitString) Create a NSCertTypeExtension with the passed bit settings.NSCertTypeExtension
(byte[] bitString) NSCertTypeExtension
(Boolean critical, Object value) Create the extension from the passed DER encoded value of the same. -
Method Summary
Modifier and TypeMethodDescriptionvoid
decode
(InputStream in) Decode the extension from the InputStream.void
Delete the attribute value.void
encode
(OutputStream out) Write the extension to the DerOutputStream.private void
Get the attribute value.Return an enumeration of names of attributes existing within this attribute.getName()
Return the name of this attribute.private static int
getPosition
(String name) boolean
isSet
(int position) Check if bit is set.static void
void
set
(int position, boolean val) Set the bit at the specified position.void
Set the attribute value.toString()
Returns a printable representation of the NSCertType.Methods inherited from class org.mozilla.jss.netscape.security.x509.Extension
clearValue, encode, getExtensionId, getExtensionValue, isCritical, setCritical, setExtensionId, setExtensionValue
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
CertType_data
private static final int[] CertType_data -
CertType_Id
Identifies the particular public key used to sign the certificate. -
NAME
Attribute names.- See Also:
-
SSL_CLIENT
- See Also:
-
SSL_SERVER
- See Also:
-
EMAIL
- See Also:
-
OBJECT_SIGNING
- See Also:
-
SSL_CA
- See Also:
-
EMAIL_CA
- See Also:
-
OBJECT_SIGNING_CA
- See Also:
-
SSL_CLIENT_BIT
public static final int SSL_CLIENT_BITAttribute names.- See Also:
-
SSL_SERVER_BIT
public static final int SSL_SERVER_BIT- See Also:
-
EMAIL_BIT
public static final int EMAIL_BIT- See Also:
-
OBJECT_SIGNING_BIT
public static final int OBJECT_SIGNING_BIT- See Also:
-
SSL_CA_BIT
public static final int SSL_CA_BIT- See Also:
-
EMAIL_CA_BIT
public static final int EMAIL_CA_BIT- See Also:
-
OBJECT_SIGNING_CA_BIT
public static final int OBJECT_SIGNING_CA_BIT- See Also:
-
NBITS
public static final int NBITS- See Also:
-
IDENT
Identifier for this attribute, to be used with the get, set, delete methods of Certificate, x509 type.- See Also:
-
mBitString
private byte[] mBitString -
mMapData
-
mAttributeNames
-
-
Constructor Details
-
NSCertTypeExtension
public NSCertTypeExtension(boolean critical, boolean[] bits) Create NSCertTypeExtension from boolean array. The criticality is set to false. -
NSCertTypeExtension
public NSCertTypeExtension(boolean[] bits) -
NSCertTypeExtension
Create a NSCertTypeExtension with the passed bit settings. The criticality is set to false.- Parameters:
bitString
- the bits to be set for the extension.- Throws:
IOException
-
NSCertTypeExtension
- Throws:
IOException
-
NSCertTypeExtension
Create the extension from the passed DER encoded value of the same.- Parameters:
critical
- true if the extension is to be treated as critical.value
- Array of DER encoded bytes of the actual value.- Throws:
IOException
- on error.
-
NSCertTypeExtension
public NSCertTypeExtension()Create a default key usage.
-
-
Method Details
-
getPosition
- Throws:
CertificateException
-
encodeThis
- Throws:
IOException
-
isSet
public boolean isSet(int position) Check if bit is set.- Parameters:
position
- the position in the bit string to check.
-
set
public void set(int position, boolean val) Set the bit at the specified position. -
set
Set the attribute value.- Specified by:
set
in interfaceCertAttrSet
- Parameters:
name
- the name of the attribute (e.g. "x509.info.key")obj
- the attribute object.- Throws:
CertificateException
- on attribute handling errors.
-
get
Get the attribute value.- Specified by:
get
in interfaceCertAttrSet
- Parameters:
name
- the name of the attribute to return.- Returns:
- attribute value
- Throws:
CertificateException
- on attribute handling errors.
-
delete
Delete the attribute value.- Specified by:
delete
in interfaceCertAttrSet
- Parameters:
name
- the name of the attribute to delete.- Throws:
CertificateException
- on attribute handling errors.
-
toString
Returns a printable representation of the NSCertType.- Specified by:
toString
in interfaceCertAttrSet
- Overrides:
toString
in classExtension
- Returns:
- value of this certificate attribute in printable form.
-
decode
Decode the extension from the InputStream.- Specified by:
decode
in interfaceCertAttrSet
- Parameters:
in
- the InputStream to unmarshal the contents from.- Throws:
IOException
- on decoding or validity errors.
-
encode
Write the extension to the DerOutputStream.- Specified by:
encode
in interfaceCertAttrSet
- Parameters:
out
- the DerOutputStream to write the extension to.- Throws:
IOException
- on encoding errors.
-
getAttributeNames
Return an enumeration of names of attributes existing within this attribute.- Specified by:
getAttributeNames
in interfaceCertAttrSet
- Returns:
- an enumeration of the attribute names.
-
getName
Return the name of this attribute.- Specified by:
getName
in interfaceCertAttrSet
- Returns:
- the name of this CertAttrSet.
-
main
-