Class 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:
  • Field Details

  • Constructor Details

    • X509Certificate

      public X509Certificate()
  • Method Details

    • getEncoded

      public abstract byte[] getEncoded() throws CertificateEncodingException
      Specified by:
      getEncoded in class Certificate
      Returns:
      The DER encoding of this certificate.
      Throws:
      CertificateEncodingException - If an error occurred.
    • getNickname

      public abstract String getNickname()
      Returns:
      The nickname of this certificate (could be null).
    • getPublicKey

      public abstract PublicKey getPublicKey()
      Specified by:
      getPublicKey in class Certificate
      Returns:
      The Public Key from this certificate.
    • getSubjectDN

      public abstract Principal getSubjectDN()
      Specified by:
      getSubjectDN in class X509Certificate
      Returns:
      The RFC 1485 ASCII encoding of the Subject Name.
    • getIssuerDN

      public abstract Principal getIssuerDN()
      Specified by:
      getIssuerDN in class X509Certificate
      Returns:
      The RFC 1485 ASCII encoding of the issuer's Subject Name.
    • getSerialNumber

      public abstract BigInteger getSerialNumber()
      Specified by:
      getSerialNumber in class X509Certificate
      Returns:
      The serial number of this certificate.
    • getVersion

      public abstract int getVersion()
      Specified by:
      getVersion in class X509Certificate
      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

      public static String encodeTrustFlags(int flags)
    • decodeTrustFlags

      public static int decodeTrustFlags(String flags) throws Exception
      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:
      setSSLTrust in interface InternalCertificate
      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:
      setEmailTrust in interface InternalCertificate
      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:
      setObjectSigningTrust in interface InternalCertificate
      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:
      getSSLTrust in interface InternalCertificate
      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:
      getEmailTrust in interface InternalCertificate
      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:
      getObjectSigningTrust in interface InternalCertificate
      Returns:
      A bitwise OR of the trust flags VALID_PEER, VALID_CA, TRUSTED_CA, USER, and TRUSTED_CLIENT_CA.
    • getTrustFlags

      public String getTrustFlags()
    • setTrustFlags

      public void setTrustFlags(String trustFlags) throws Exception
      Throws:
      Exception