Top Description Fields Constructors Methods
org.bouncycastle.jce.netscape

public Class NetscapeCertRequest

extends ASN1Object
Class Inheritance
Imports
java.io.ByteArrayInputStream, .ByteArrayOutputStream, .IOException, java.security.InvalidKeyException, .KeyFactory, .NoSuchAlgorithmException, .NoSuchProviderException, .PrivateKey, .PublicKey, .SecureRandom, .Signature, .SignatureException, java.security.spec.InvalidKeySpecException, .X509EncodedKeySpec, org.bouncycastle.asn1.ASN1EncodableVector, .ASN1Encoding, .ASN1IA5String, .ASN1InputStream, .ASN1Object, .ASN1Primitive, .ASN1Sequence, .DERBitString, .DERIA5String, .DERSequence, org.bouncycastle.asn1.x509.AlgorithmIdentifier, .SubjectPublicKeyInfo

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

Modifier and TypeField and Description
pack-priv String
pack-priv DERBitString
pack-priv AlgorithmIdentifier
pack-priv PublicKey
pack-priv AlgorithmIdentifier
pack-priv byte[]

Constructor Summary

AccessConstructor and Description
public
NetscapeCertRequest(byte[] req)

public
public
NetscapeCertRequest(String challenge, AlgorithmIdentifier signing_alg, PublicKey pub_key)

Method Summary

Modifier and TypeMethod and Description
public String
public AlgorithmIdentifier
private ASN1Primitive
public PublicKey
private static ASN1Sequence
getReq(byte[] r)

public AlgorithmIdentifier
public void
public void
public void
public void
public void
sign(PrivateKey priv_key)

public void
sign(PrivateKey priv_key, SecureRandom rand)

public ASN1Primitive
toASN1Primitive()

Implements abstract org.bouncycastle.asn1.ASN1Object.toASN1Primitive.

Implements org.bouncycastle.asn1.ASN1Encodable.toASN1Primitive.

Method providing a primitive representation of this object suitable for encoding.

public boolean
verify(String challenge)

Inherited from org.bouncycastle.asn1.ASN1Object:
encodeToencodeToequalsgetEncodedgetEncodedhasEncodedTagValuehashCode

Field Detail

challengeback to summary
pack-priv String challenge
contentback to summary
pack-priv DERBitString content
keyAlgback to summary
pack-priv AlgorithmIdentifier keyAlg
pubkeyback to summary
pack-priv PublicKey pubkey
sigAlgback to summary
pack-priv AlgorithmIdentifier sigAlg
sigBitsback to summary
pack-priv byte[] sigBits

Constructor Detail

NetscapeCertRequestback to summary
public NetscapeCertRequest(byte[] req) throws IOException
NetscapeCertRequestback to summary
public NetscapeCertRequest(ASN1Sequence spkac)
NetscapeCertRequestback to summary
public NetscapeCertRequest(String challenge, AlgorithmIdentifier signing_alg, PublicKey pub_key) throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchProviderException

Method Detail

getChallengeback to summary
public String getChallenge()
getKeyAlgorithmback to summary
public AlgorithmIdentifier getKeyAlgorithm()
getKeySpecback to summary
private ASN1Primitive getKeySpec() throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchProviderException
getPublicKeyback to summary
public PublicKey getPublicKey()
getReqback to summary
private static ASN1Sequence getReq(byte[] r) throws IOException
getSigningAlgorithmback to summary
public AlgorithmIdentifier getSigningAlgorithm()
setChallengeback to summary
public void setChallenge(String value)
setKeyAlgorithmback to summary
public void setKeyAlgorithm(AlgorithmIdentifier value)
setPublicKeyback to summary
public void setPublicKey(PublicKey value)
setSigningAlgorithmback to summary
public void setSigningAlgorithm(AlgorithmIdentifier value)
signback to summary
public void sign(PrivateKey priv_key) throws NoSuchAlgorithmException, InvalidKeyException, SignatureException, NoSuchProviderException, InvalidKeySpecException
signback to summary
public void sign(PrivateKey priv_key, SecureRandom rand) throws NoSuchAlgorithmException, InvalidKeyException, SignatureException, NoSuchProviderException, InvalidKeySpecException
toASN1Primitiveback to summary
public ASN1Primitive toASN1Primitive()

Implements abstract org.bouncycastle.asn1.ASN1Object.toASN1Primitive.

Implements org.bouncycastle.asn1.ASN1Encodable.toASN1Primitive.

Doc from org.bouncycastle.asn1.ASN1Object.toASN1Primitive.

Method providing a primitive representation of this object suitable for encoding.

Returns:ASN1Primitive

a primitive representation of this object.

verifyback to summary
public boolean verify(String challenge) throws NoSuchAlgorithmException, InvalidKeyException, SignatureException, NoSuchProviderException