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:
PublicKey's encoded-format has to be X.509.SignedPublicKeyAndChallenge ::= SEQUENCE { publicKeyAndChallenge PublicKeyAndChallenge, signatureAlgorithm AlgorithmIdentifier, signature BIT STRING }
-
-
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 StringgetChallenge()AlgorithmIdentifiergetKeyAlgorithm()PublicKeygetPublicKey()AlgorithmIdentifiergetSigningAlgorithm()voidsetChallenge(String value)voidsetKeyAlgorithm(AlgorithmIdentifier value)voidsetPublicKey(PublicKey value)voidsetSigningAlgorithm(AlgorithmIdentifier value)voidsign(PrivateKey priv_key)voidsign(PrivateKey priv_key, SecureRandom rand)ASN1PrimitivetoASN1Primitive()Method providing a primitive representation of this object suitable for encoding.booleanverify(String challenge)-
Methods inherited from class org.bouncycastle.asn1.ASN1Object
equals, getEncoded, getEncoded, hasEncodedTagValue, hashCode, toASN1Object
-
-
-
-
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: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.
-
-