Class NetscapeCertRequest

  • All Implemented Interfaces:
    ASN1Encodable, Encodable

    public class NetscapeCertRequest
    extends ASN1Object
    Handles NetScape certificate request (KEYGEN), these are constructed as:
       SignedPublicKeyAndChallenge ::= SEQUENCE {
         publicKeyAndChallenge    PublicKeyAndChallenge,
         signatureAlgorithm       AlgorithmIdentifier,
         signature                BIT STRING
       }
     
    PublicKey's encoded-format has to be X.509.
    • Constructor Detail

      • NetscapeCertRequest

        public NetscapeCertRequest​(byte[] req)
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • NetscapeCertRequest

        public NetscapeCertRequest​(ASN1Sequence spkac)
      • NetscapeCertRequest

        public NetscapeCertRequest​(java.lang.String challenge,
                                   AlgorithmIdentifier signing_alg,
                                   java.security.PublicKey pub_key)
                            throws java.security.NoSuchAlgorithmException,
                                   java.security.spec.InvalidKeySpecException,
                                   java.security.NoSuchProviderException
        Throws:
        java.security.NoSuchAlgorithmException
        java.security.spec.InvalidKeySpecException
        java.security.NoSuchProviderException
    • Method Detail

      • getChallenge

        public java.lang.String getChallenge()
      • setChallenge

        public void setChallenge​(java.lang.String value)
      • getPublicKey

        public java.security.PublicKey getPublicKey()
      • setPublicKey

        public void setPublicKey​(java.security.PublicKey value)
      • verify

        public boolean verify​(java.lang.String challenge)
                       throws java.security.NoSuchAlgorithmException,
                              java.security.InvalidKeyException,
                              java.security.SignatureException,
                              java.security.NoSuchProviderException
        Throws:
        java.security.NoSuchAlgorithmException
        java.security.InvalidKeyException
        java.security.SignatureException
        java.security.NoSuchProviderException
      • sign

        public void sign​(java.security.PrivateKey priv_key)
                  throws java.security.NoSuchAlgorithmException,
                         java.security.InvalidKeyException,
                         java.security.SignatureException,
                         java.security.NoSuchProviderException,
                         java.security.spec.InvalidKeySpecException
        Throws:
        java.security.NoSuchAlgorithmException
        java.security.InvalidKeyException
        java.security.SignatureException
        java.security.NoSuchProviderException
        java.security.spec.InvalidKeySpecException
      • sign

        public void sign​(java.security.PrivateKey priv_key,
                         java.security.SecureRandom rand)
                  throws java.security.NoSuchAlgorithmException,
                         java.security.InvalidKeyException,
                         java.security.SignatureException,
                         java.security.NoSuchProviderException,
                         java.security.spec.InvalidKeySpecException
        Throws:
        java.security.NoSuchAlgorithmException
        java.security.InvalidKeyException
        java.security.SignatureException
        java.security.NoSuchProviderException
        java.security.spec.InvalidKeySpecException