Package org.gudy.bouncycastle.jce
Class PKCS10CertificationRequest
- java.lang.Object
-
- org.gudy.bouncycastle.asn1.pkcs.CertificationRequest
-
- org.gudy.bouncycastle.jce.PKCS10CertificationRequest
-
- All Implemented Interfaces:
DEREncodable
public class PKCS10CertificationRequest extends CertificationRequest
A class for verifying and creating PKCS10 Certification requests.CertificationRequest ::= SEQUENCE { certificationRequestInfo CertificationRequestInfo, signatureAlgorithm AlgorithmIdentifier{{ SignatureAlgorithms }}, signature BIT STRING } CertificationRequestInfo ::= SEQUENCE { version INTEGER { v1(0) } (v1,...), subject Name, subjectPKInfo SubjectPublicKeyInfo{{ PKInfoAlgorithms }}, attributes [0] Attributes{{ CRIAttributes }} } Attributes { ATTRIBUTE:IOSet } ::= SET OF Attribute{{ IOSet }} Attribute { ATTRIBUTE:IOSet } ::= SEQUENCE { type ATTRIBUTE.&id({IOSet}), values SET SIZE(1..MAX) OF ATTRIBUTE.&Type({IOSet}{\@type}) }
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.Hashtable
algorithms
private static java.util.Hashtable
oids
-
Fields inherited from class org.gudy.bouncycastle.asn1.pkcs.CertificationRequest
reqInfo, sigAlgId, sigBits
-
-
Constructor Summary
Constructors Constructor Description PKCS10CertificationRequest(byte[] bytes)
construct a PKCS10 certification request from a DER encoded byte stream.PKCS10CertificationRequest(java.lang.String signatureAlgorithm, X509Name subject, java.security.PublicKey key, ASN1Set attributes, java.security.PrivateKey signingKey)
create a PKCS10 certfication request using the BC provider.PKCS10CertificationRequest(java.lang.String signatureAlgorithm, X509Name subject, java.security.PublicKey key, ASN1Set attributes, java.security.PrivateKey signingKey, java.lang.String provider)
create a PKCS10 certfication request using the named provider.PKCS10CertificationRequest(ASN1Sequence sequence)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getEncoded()
return a DER encoded byte array representing this objectjava.security.PublicKey
getPublicKey()
return the public key associated with the certification request - the public key is created using the BC provider.java.security.PublicKey
getPublicKey(java.lang.String provider)
private static ASN1Sequence
toDERSequence(byte[] bytes)
boolean
verify()
verify the request using the BC provider.boolean
verify(java.lang.String provider)
-
Methods inherited from class org.gudy.bouncycastle.asn1.pkcs.CertificationRequest
getCertificationRequestInfo, getDERObject, getSignature, getSignatureAlgorithm
-
-
-
-
Constructor Detail
-
PKCS10CertificationRequest
public PKCS10CertificationRequest(byte[] bytes)
construct a PKCS10 certification request from a DER encoded byte stream.
-
PKCS10CertificationRequest
public PKCS10CertificationRequest(ASN1Sequence sequence)
-
PKCS10CertificationRequest
public PKCS10CertificationRequest(java.lang.String signatureAlgorithm, X509Name subject, java.security.PublicKey key, ASN1Set attributes, java.security.PrivateKey signingKey) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.InvalidKeyException, java.security.SignatureException
create a PKCS10 certfication request using the BC provider.- Throws:
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException
java.security.InvalidKeyException
java.security.SignatureException
-
PKCS10CertificationRequest
public PKCS10CertificationRequest(java.lang.String signatureAlgorithm, X509Name subject, java.security.PublicKey key, ASN1Set attributes, java.security.PrivateKey signingKey, java.lang.String provider) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.InvalidKeyException, java.security.SignatureException
create a PKCS10 certfication request using the named provider.- Throws:
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException
java.security.InvalidKeyException
java.security.SignatureException
-
-
Method Detail
-
toDERSequence
private static ASN1Sequence toDERSequence(byte[] bytes)
-
getPublicKey
public java.security.PublicKey getPublicKey() throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.InvalidKeyException
return the public key associated with the certification request - the public key is created using the BC provider.- Throws:
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException
java.security.InvalidKeyException
-
getPublicKey
public java.security.PublicKey getPublicKey(java.lang.String provider) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.InvalidKeyException
- Throws:
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException
java.security.InvalidKeyException
-
verify
public boolean verify() throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.InvalidKeyException, java.security.SignatureException
verify the request using the BC provider.- Throws:
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException
java.security.InvalidKeyException
java.security.SignatureException
-
verify
public boolean verify(java.lang.String provider) throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.InvalidKeyException, java.security.SignatureException
- Throws:
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException
java.security.InvalidKeyException
java.security.SignatureException
-
getEncoded
public byte[] getEncoded()
return a DER encoded byte array representing this object
-
-