Package org.bouncycastle.pkcs.jcajce
Class JcaPKCS10CertificationRequest
java.lang.Object
org.bouncycastle.pkcs.PKCS10CertificationRequest
org.bouncycastle.pkcs.jcajce.JcaPKCS10CertificationRequest
JCA-aware extension of
PKCS10CertificationRequest that returns the request's public
key as a JCA PublicKey. Use setProvider(java.lang.String) to pin the underlying
KeyFactory lookup to a specific JCE provider.-
Constructor Summary
ConstructorsConstructorDescriptionJcaPKCS10CertificationRequest(byte[] encoding) Parse a BER/DER encoded PKCS#10 request.JcaPKCS10CertificationRequest(org.bouncycastle.asn1.pkcs.CertificationRequest certificationRequest) Wrap a parsedCertificationRequest.JcaPKCS10CertificationRequest(PKCS10CertificationRequest requestHolder) Re-wrap an existingPKCS10CertificationRequestas a JCA-aware holder. -
Method Summary
Modifier and TypeMethodDescriptionReturn the public key carried by the request as a JCAPublicKey.setProvider(String providerName) PinKeyFactorylookups to the named JCE provider.setProvider(Provider provider) PinKeyFactorylookups to the supplied JCE provider.Methods inherited from class org.bouncycastle.pkcs.PKCS10CertificationRequest
equals, getAttributes, getAttributes, getEncoded, getRequestedExtensions, getSignature, getSignatureAlgorithm, getSubject, getSubjectPublicKeyInfo, hasAltPublicKey, hashCode, isAltSignatureValid, isSignatureValid, toASN1Structure
-
Constructor Details
-
JcaPKCS10CertificationRequest
public JcaPKCS10CertificationRequest(org.bouncycastle.asn1.pkcs.CertificationRequest certificationRequest) Wrap a parsedCertificationRequest.- Parameters:
certificationRequest- the underlying request.
-
JcaPKCS10CertificationRequest
Parse a BER/DER encoded PKCS#10 request.- Parameters:
encoding- the encoded request bytes.- Throws:
IOException- if the data is not a valid CertificationRequest.
-
JcaPKCS10CertificationRequest
Re-wrap an existingPKCS10CertificationRequestas a JCA-aware holder.- Parameters:
requestHolder- the existing holder.
-
-
Method Details
-
setProvider
PinKeyFactorylookups to the named JCE provider.- Parameters:
providerName- name of the registered provider.- Returns:
- this holder.
-
setProvider
PinKeyFactorylookups to the supplied JCE provider.- Parameters:
provider- the provider instance.- Returns:
- this holder.
-
getPublicKey
Return the public key carried by the request as a JCAPublicKey.- Returns:
- the decoded public key.
- Throws:
InvalidKeyException- if the SubjectPublicKeyInfo cannot be parsed.NoSuchAlgorithmException- if no matching KeyFactory can be located.
-