Package org.bouncycastle.jce.netscape
Class NetscapeCertRequest
java.lang.Object
org.bouncycastle.asn1.ASN1Object
org.bouncycastle.jce.netscape.NetscapeCertRequest
- All Implemented Interfaces:
ASN1Encodable,Encodable
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 Summary
ConstructorsConstructorDescriptionNetscapeCertRequest(byte[] req) NetscapeCertRequest(String challenge, AlgorithmIdentifier signing_alg, PublicKey pub_key) NetscapeCertRequest(ASN1Sequence spkac) -
Method Summary
Modifier and TypeMethodDescriptionvoidsetChallenge(String value) voidvoidsetPublicKey(PublicKey value) voidvoidsign(PrivateKey priv_key) voidsign(PrivateKey priv_key, SecureRandom rand) Method providing a primitive representation of this object suitable for encoding.booleanMethods inherited from class org.bouncycastle.asn1.ASN1Object
encodeTo, encodeTo, equals, getEncoded, getEncoded, hasEncodedTagValue, hashCode
-
Constructor Details
-
NetscapeCertRequest
- Throws:
IOException
-
NetscapeCertRequest
-
NetscapeCertRequest
public NetscapeCertRequest(String challenge, AlgorithmIdentifier signing_alg, PublicKey pub_key) throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchProviderException
-
-
Method Details
-
getChallenge
-
setChallenge
-
getSigningAlgorithm
-
setSigningAlgorithm
-
getKeyAlgorithm
-
setKeyAlgorithm
-
getPublicKey
-
setPublicKey
-
verify
public boolean verify(String challenge) throws NoSuchAlgorithmException, InvalidKeyException, SignatureException, NoSuchProviderException -
sign
public void sign(PrivateKey priv_key) throws NoSuchAlgorithmException, InvalidKeyException, SignatureException, NoSuchProviderException, InvalidKeySpecException -
sign
public void sign(PrivateKey priv_key, SecureRandom rand) throws NoSuchAlgorithmException, InvalidKeyException, SignatureException, NoSuchProviderException, InvalidKeySpecException -
toASN1Primitive
Description copied from class:ASN1ObjectMethod providing a primitive representation of this object suitable for encoding.- Specified by:
toASN1Primitivein interfaceASN1Encodable- Specified by:
toASN1Primitivein classASN1Object- Returns:
- a primitive representation of this object.
-