Package org.mozilla.jss.crypto
Class X509Certificate
java.lang.Object
java.security.cert.Certificate
java.security.cert.X509Certificate
org.mozilla.jss.crypto.X509Certificate
- All Implemented Interfaces:
Serializable,X509Extension,InternalCertificate,TokenCertificate
- Direct Known Subclasses:
PK11Cert
public abstract class X509Certificate
extends X509Certificate
implements InternalCertificate, TokenCertificate
Certificates handled by JSS. All certificates handled by JSS are
of this type.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.security.cert.Certificate
Certificate.CertificateRep -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intdecodeTrustFlags(String flags) static StringencodeTrustFlags(int flags) intGet the email (S/MIME) trust flags for this certificate.abstract byte[]abstract Principalabstract StringintGet the object signing trust flags for this certificate.abstract PublicKeyabstract BigIntegerintGet the SSL trust flags for this certificate.abstract Principalabstract intgetTrust(int type) Gets the trust flags for this cert.abstract intstatic booleanisTrustFlagEnabled(int flag, int flags) voidsetEmailTrust(int trust) Set the email (S/MIME) trust flags for this certificate.voidsetObjectSigningTrust(int trust) Set the object signing trust flags for this certificate.voidsetSSLTrust(int trust) Set the SSL trust flags for this certificate.abstract voidsetTrust(int type, int trust) Sets the trust flags for this cert.voidsetTrustFlags(String trustFlags) Methods inherited from class java.security.cert.X509Certificate
checkValidity, checkValidity, getBasicConstraints, getExtendedKeyUsage, getIssuerAlternativeNames, getIssuerUniqueID, getIssuerX500Principal, getKeyUsage, getNotAfter, getNotBefore, getSigAlgName, getSigAlgOID, getSigAlgParams, getSignature, getSubjectAlternativeNames, getSubjectUniqueID, getSubjectX500Principal, getTBSCertificate, verifyMethods inherited from class java.security.cert.Certificate
equals, getType, hashCode, toString, verify, verify, writeReplaceMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.mozilla.jss.crypto.TokenCertificate
getOwningToken, getUniqueIDMethods inherited from interface java.security.cert.X509Extension
getCriticalExtensionOIDs, getExtensionValue, getNonCriticalExtensionOIDs, hasUnsupportedCriticalExtension
-
Field Details
-
VALID_PEER
public static final int VALID_PEER- See Also:
-
TRUSTED_PEER
public static final int TRUSTED_PEER- See Also:
-
SEND_WARN
public static final int SEND_WARN- See Also:
-
VALID_CA
public static final int VALID_CA- See Also:
-
TRUSTED_CA
public static final int TRUSTED_CA- See Also:
-
NS_TRUSTED_CA
public static final int NS_TRUSTED_CA- See Also:
-
USER
public static final int USER- See Also:
-
TRUSTED_CLIENT_CA
public static final int TRUSTED_CLIENT_CA- See Also:
-
INVISIBLE_CA
public static final int INVISIBLE_CA- See Also:
-
GOVT_APPROVED_CA
public static final int GOVT_APPROVED_CA- See Also:
-
SSL
public static final int SSL- See Also:
-
EMAIL
public static final int EMAIL- See Also:
-
OBJECT_SIGNING
public static final int OBJECT_SIGNING- See Also:
-
-
Constructor Details
-
X509Certificate
public X509Certificate()
-
-
Method Details
-
getEncoded
- Specified by:
getEncodedin classCertificate- Returns:
- The DER encoding of this certificate.
- Throws:
CertificateEncodingException- If an error occurred.
-
getNickname
- Returns:
- The nickname of this certificate (could be null).
-
getPublicKey
- Specified by:
getPublicKeyin classCertificate- Returns:
- The Public Key from this certificate.
-
getSubjectDN
- Specified by:
getSubjectDNin classX509Certificate- Returns:
- The RFC 1485 ASCII encoding of the Subject Name.
-
getIssuerDN
- Specified by:
getIssuerDNin classX509Certificate- Returns:
- The RFC 1485 ASCII encoding of the issuer's Subject Name.
-
getSerialNumber
- Specified by:
getSerialNumberin classX509Certificate- Returns:
- The serial number of this certificate.
-
getVersion
public abstract int getVersion()- Specified by:
getVersionin classX509Certificate- Returns:
- the version number of this X.509 certificate. 0 means v1, 1 means v2, 2 means v3.
-
isTrustFlagEnabled
public static boolean isTrustFlagEnabled(int flag, int flags) -
encodeTrustFlags
-
decodeTrustFlags
- Throws:
Exception
-
setTrust
public abstract 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
public abstract 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.
-
setSSLTrust
public void setSSLTrust(int trust) Set the SSL trust flags for this certificate.- Specified by:
setSSLTrustin interfaceInternalCertificate- Parameters:
trust- A bitwise OR of the trust flags VALID_PEER, VALID_CA, TRUSTED_CA, USER, and TRUSTED_CLIENT_CA.
-
setEmailTrust
public void setEmailTrust(int trust) Set the email (S/MIME) trust flags for this certificate.- Specified by:
setEmailTrustin interfaceInternalCertificate- Parameters:
trust- A bitwise OR of the trust flags VALID_PEER, VALID_CA, TRUSTED_CA, USER, and TRUSTED_CLIENT_CA.
-
setObjectSigningTrust
public void setObjectSigningTrust(int trust) Set the object signing trust flags for this certificate.- Specified by:
setObjectSigningTrustin interfaceInternalCertificate- Parameters:
trust- A bitwise OR of the trust flags VALID_PEER, VALID_CA, TRUSTED_CA, USER, and TRUSTED_CLIENT_CA.
-
getSSLTrust
public int getSSLTrust()Get the SSL trust flags for this certificate.- Specified by:
getSSLTrustin interfaceInternalCertificate- Returns:
- A bitwise OR of the trust flags VALID_PEER, VALID_CA, TRUSTED_CA, USER, and TRUSTED_CLIENT_CA.
-
getEmailTrust
public int getEmailTrust()Get the email (S/MIME) trust flags for this certificate.- Specified by:
getEmailTrustin interfaceInternalCertificate- Returns:
- A bitwise OR of the trust flags VALID_PEER, VALID_CA, TRUSTED_CA, USER, and TRUSTED_CLIENT_CA.
-
getObjectSigningTrust
public int getObjectSigningTrust()Get the object signing trust flags for this certificate.- Specified by:
getObjectSigningTrustin interfaceInternalCertificate- Returns:
- A bitwise OR of the trust flags VALID_PEER, VALID_CA, TRUSTED_CA, USER, and TRUSTED_CLIENT_CA.
-
getTrustFlags
-
setTrustFlags
- Throws:
Exception
-