Package org.mozilla.jss.pkcs11
Class PK11Cert
- java.lang.Object
-
- 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
Nested Classes Modifier and Type Class Description protected static classPK11Cert.StringPrincipalA class that implements Principal with a String.
-
Field Summary
Fields Modifier and Type Field Description protected org.mozilla.jss.pkcs11.CertProxycertProxyprotected java.lang.Stringnicknameprotected TokenProxytokenProxy
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getEncoded()java.security.PrincipalgetIssuerDN()protected java.lang.StringgetIssuerDNString()java.lang.StringgetNickname()protected CryptoTokengetOwningToken()java.security.PublicKeygetPublicKey()java.math.BigIntegergetSerialNumber()protected byte[]getSerialNumberByteArray()java.security.PrincipalgetSubjectDN()protected java.lang.StringgetSubjectDNString()protected intgetTrust(int type)Gets the trust flags for this cert.protected byte[]getUniqueID()intgetVersion()protected voidsetTrust(int type, int trust)Sets the trust flags for this cert.
-
-
-
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- Specified by:
getEncodedin interfaceX509Certificate- Returns:
- The DER encoding of this certificate.
- Throws:
java.security.cert.CertificateEncodingException- If an error occurred.
-
getNickname
public java.lang.String getNickname()
- Specified by:
getNicknamein interfaceX509Certificate- Returns:
- The nickname of this certificate (could be null).
-
getSubjectDN
public java.security.Principal getSubjectDN()
- Specified by:
getSubjectDNin interfaceX509Certificate- Returns:
- The RFC 1485 ASCII encoding of the Subject Name.
-
getIssuerDN
public java.security.Principal getIssuerDN()
- Specified by:
getIssuerDNin interfaceX509Certificate- Returns:
- The RFC 1485 ASCII encoding of the issuer's Subject Name.
-
getSerialNumber
public java.math.BigInteger getSerialNumber()
- Specified by:
getSerialNumberin interfaceX509Certificate- Returns:
- The serial number of this certificate.
-
getSerialNumberByteArray
protected byte[] getSerialNumberByteArray()
-
getSubjectDNString
protected java.lang.String getSubjectDNString()
-
getIssuerDNString
protected java.lang.String getIssuerDNString()
-
getPublicKey
public java.security.PublicKey getPublicKey()
- Specified by:
getPublicKeyin interfaceX509Certificate- Returns:
- The Public Key from this certificate.
-
getVersion
public int getVersion()
- Specified by:
getVersionin interfaceX509Certificate- 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.
-
-