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