org.bouncycastle.jce.netscape

## Class NetscapeCertRequest

- java.lang.Object
- - org.bouncycastle.asn1.ASN1Encodable
  - - org.bouncycastle.jce.netscape.NetscapeCertRequest

All Implemented Interfaces:
  DEREncodable

    public class NetscapeCertRequest
    extends ASN1Encodable

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.

### Field Summary

### Fields inherited from class org.bouncycastle.asn1.ASN1Encodable

`BER, DER`

### Constructor Summary

Constructors
Constructor and Description
`NetscapeCertRequest(ASN1Sequence spkac)`
`NetscapeCertRequest(byte[] req)`
`NetscapeCertRequest(java.lang.String challenge, AlgorithmIdentifier signing_alg, java.security.PublicKey pub_key)`

### Method Summary

Methods
`java.lang.String` `getChallenge()`
`AlgorithmIdentifier` `getKeyAlgorithm()`
`java.security.PublicKey` `getPublicKey()`
`AlgorithmIdentifier` `getSigningAlgorithm()`
`void` `setChallenge(java.lang.String value)`
`void` `setKeyAlgorithm(AlgorithmIdentifier value)`
`void` `setPublicKey(java.security.PublicKey value)`
`void` `setSigningAlgorithm(AlgorithmIdentifier value)`
`void` `sign(java.security.PrivateKey priv_key)`
`void` `sign(java.security.PrivateKey priv_key, java.security.SecureRandom rand)`
`DERObject` `toASN1Object()`
`boolean` `verify(java.lang.String challenge)`

### Methods inherited from class org.bouncycastle.asn1.ASN1Encodable

`equals, getDEREncoded, getDERObject, getEncoded, getEncoded, hashCode`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

### 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)

#### getSigningAlgorithm

    public AlgorithmIdentifier getSigningAlgorithm()

#### setSigningAlgorithm

    public void setSigningAlgorithm(AlgorithmIdentifier value)

#### getKeyAlgorithm

    public AlgorithmIdentifier getKeyAlgorithm()

#### setKeyAlgorithm

    public void setKeyAlgorithm(AlgorithmIdentifier 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`

#### toASN1Object

    public DERObject toASN1Object()

Specified by:
  `toASN1Object` in class `ASN1Encodable`