You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.




org.mozilla.jss.pkcs11
Class PK11Cert

java.lang.Object
  extended by org.mozilla.jss.pkcs11.PK11Cert
All Implemented Interfaces:
X509Certificate
Direct Known Subclasses:
PK11InternalCert, PK11TokenCert

public class PK11Cert
extends java.lang.Object
implements X509Certificate


Nested Class Summary
protected static class PK11Cert.StringPrincipal
          A class that implements Principal with a String.
 
Field Summary
protected  org.mozilla.jss.pkcs11.CertProxy certProxy
           
protected  java.lang.String nickname
           
protected  TokenProxy tokenProxy
           
 
Method Summary
 byte[] getEncoded()
          Returns the DER encoding of this certificate.
 java.security.Principal getIssuerDN()
          Returns the RFC 1485 ASCII encoding of the issuer's Subject Name.
protected  java.lang.String getIssuerDNString()
           
 java.lang.String getNickname()
          Returns the possibly-null nickname of this certificate.
protected  CryptoToken getOwningToken()
           
 java.security.PublicKey getPublicKey()
          Extracts the Public Key from this certificate.
 java.math.BigInteger getSerialNumber()
          Returns the serial number of this certificate.
protected  byte[] getSerialNumberByteArray()
           
 java.security.Principal getSubjectDN()
          Returns the RFC 1485 ASCII encoding of the Subject Name.
protected  java.lang.String getSubjectDNString()
           
protected  int getTrust(int type)
          Gets the trust flags for this cert.
protected  byte[] getUniqueID()
           
 int getVersion()
           
protected  void setTrust(int type, int trust)
          Sets the trust flags for this cert.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

certProxy

protected org.mozilla.jss.pkcs11.CertProxy certProxy

tokenProxy

protected TokenProxy tokenProxy

nickname

protected java.lang.String nickname
Method Detail

getEncoded

public byte[] getEncoded()
                  throws java.security.cert.CertificateEncodingException
Description copied from interface: X509Certificate
Returns the DER encoding of this certificate.

Specified by:
getEncoded in interface X509Certificate
Throws:
java.security.cert.CertificateEncodingException

getNickname

public java.lang.String getNickname()
Description copied from interface: X509Certificate
Returns the possibly-null nickname of this certificate.

Specified by:
getNickname in interface X509Certificate

getSubjectDN

public java.security.Principal getSubjectDN()
Description copied from interface: X509Certificate
Returns the RFC 1485 ASCII encoding of the Subject Name.

Specified by:
getSubjectDN in interface X509Certificate

getIssuerDN

public java.security.Principal getIssuerDN()
Description copied from interface: X509Certificate
Returns the RFC 1485 ASCII encoding of the issuer's Subject Name.

Specified by:
getIssuerDN in interface X509Certificate

getSerialNumber

public java.math.BigInteger getSerialNumber()
Description copied from interface: X509Certificate
Returns the serial number of this certificate.

Specified by:
getSerialNumber in interface X509Certificate

getSerialNumberByteArray

protected byte[] getSerialNumberByteArray()

getSubjectDNString

protected java.lang.String getSubjectDNString()

getIssuerDNString

protected java.lang.String getIssuerDNString()

getPublicKey

public java.security.PublicKey getPublicKey()
Description copied from interface: X509Certificate
Extracts the Public Key from this certificate.

Specified by:
getPublicKey in interface X509Certificate

getVersion

public int getVersion()
Specified by:
getVersion in interface X509Certificate
Returns:
the version number of this X.509 certificate. 0 means v1, 1 means v2, 2 means v3.

getUniqueID

protected byte[] getUniqueID()

getOwningToken

protected CryptoToken getOwningToken()

setTrust

protected void setTrust(int type,
                        int trust)
Sets the trust flags for this cert.

Parameters:
type - SSL, EMAIL, or OBJECT_SIGNING.
trust - The trust flags for this type of trust.

getTrust

protected int getTrust(int type)
Gets the trust flags for this cert.

Parameters:
type - SSL, EMAIL, or OBJECT_SIGNING.
Returns:
The trust flags for this type of trust.