Bouncy Castle Cryptography Library 1.85

org.bouncycastle.pkcs.jcajce
Class JcaPKCS10CertificationRequest

java.lang.Object
  extended byorg.bouncycastle.pkcs.PKCS10CertificationRequest
      extended byorg.bouncycastle.pkcs.jcajce.JcaPKCS10CertificationRequest

public class JcaPKCS10CertificationRequest
extends PKCS10CertificationRequest

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
JcaPKCS10CertificationRequest(byte[] encoding)
          Parse a BER/DER encoded PKCS#10 request.
JcaPKCS10CertificationRequest(org.bouncycastle.asn1.pkcs.CertificationRequest certificationRequest)
          Wrap a parsed CertificationRequest.
JcaPKCS10CertificationRequest(PKCS10CertificationRequest requestHolder)
          Re-wrap an existing PKCS10CertificationRequest as a JCA-aware holder.
 
Method Summary
 java.security.PublicKey getPublicKey()
          Return the public key carried by the request as a JCA PublicKey.
 JcaPKCS10CertificationRequest setProvider(java.security.Provider provider)
          Pin KeyFactory lookups to the supplied JCE provider.
 JcaPKCS10CertificationRequest setProvider(java.lang.String providerName)
          Pin KeyFactory lookups to the named JCE provider.
 
Methods inherited from class org.bouncycastle.pkcs.PKCS10CertificationRequest
equals, getAttributes, getAttributes, getEncoded, getRequestedExtensions, getSignature, getSignatureAlgorithm, getSubject, getSubjectPublicKeyInfo, hasAltPublicKey, hashCode, isAltSignatureValid, isSignatureValid, toASN1Structure
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JcaPKCS10CertificationRequest

public JcaPKCS10CertificationRequest(org.bouncycastle.asn1.pkcs.CertificationRequest certificationRequest)
Wrap a parsed CertificationRequest.

Parameters:
certificationRequest - the underlying request.

JcaPKCS10CertificationRequest

public JcaPKCS10CertificationRequest(byte[] encoding)
                              throws java.io.IOException
Parse a BER/DER encoded PKCS#10 request.

Parameters:
encoding - the encoded request bytes.
Throws:
java.io.IOException - if the data is not a valid CertificationRequest.

JcaPKCS10CertificationRequest

public JcaPKCS10CertificationRequest(PKCS10CertificationRequest requestHolder)
Re-wrap an existing PKCS10CertificationRequest as a JCA-aware holder.

Parameters:
requestHolder - the existing holder.
Method Detail

setProvider

public JcaPKCS10CertificationRequest setProvider(java.lang.String providerName)
Pin KeyFactory lookups to the named JCE provider.

Parameters:
providerName - name of the registered provider.
Returns:
this holder.

setProvider

public JcaPKCS10CertificationRequest setProvider(java.security.Provider provider)
Pin KeyFactory lookups to the supplied JCE provider.

Parameters:
provider - the provider instance.
Returns:
this holder.

getPublicKey

public java.security.PublicKey getPublicKey()
                                     throws java.security.InvalidKeyException,
                                            java.security.NoSuchAlgorithmException
Return the public key carried by the request as a JCA PublicKey.

Returns:
the decoded public key.
Throws:
java.security.InvalidKeyException - if the SubjectPublicKeyInfo cannot be parsed.
java.security.NoSuchAlgorithmException - if no matching KeyFactory can be located.

Bouncy Castle Cryptography Library 1.85