org.hardtokenmgmt.core.util
Class PKCS11CertificationRequest

java.lang.Object
  extended by org.bouncycastle.asn1.ASN1Encodable
      extended by org.bouncycastle.asn1.pkcs.CertificationRequest
          extended by org.hardtokenmgmt.core.util.PKCS11CertificationRequest
All Implemented Interfaces:
org.bouncycastle.asn1.DEREncodable

public class PKCS11CertificationRequest
extends org.bouncycastle.asn1.pkcs.CertificationRequest


Field Summary
 
Fields inherited from class org.bouncycastle.asn1.pkcs.CertificationRequest
reqInfo, sigAlgId, sigBits
 
Fields inherited from class org.bouncycastle.asn1.ASN1Encodable
BER, DER
 
Constructor Summary
PKCS11CertificationRequest(org.bouncycastle.asn1.ASN1Sequence sequence)
           
PKCS11CertificationRequest(byte[] bytes)
          construct a PKCS10 certification request from a DER encoded byte stream.
PKCS11CertificationRequest(iaik.pkcs.pkcs11.Session session, iaik.pkcs.pkcs11.Mechanism mechanism, org.bouncycastle.asn1.x509.X509Name subject, java.security.PublicKey key, org.bouncycastle.asn1.ASN1Set attributes, iaik.pkcs.pkcs11.objects.PrivateKey signingKey)
          create a PKCS10 certfication request using the given pkcs11 private key
 
Method Summary
 byte[] getEncoded()
          return a DER encoded byte array representing this object
 org.bouncycastle.jce.PKCS10CertificationRequest getPKCS10CertificationRequest()
           
 java.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)
           
 boolean verify()
          verify the request using the BC provider.
 boolean verify(java.lang.String provider)
           
 
Methods inherited from class org.bouncycastle.asn1.pkcs.CertificationRequest
getCertificationRequestInfo, getInstance, getSignature, getSignatureAlgorithm, toASN1Object
 
Methods inherited from class org.bouncycastle.asn1.ASN1Encodable
equals, getDEREncoded, getDERObject, getEncoded, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PKCS11CertificationRequest

public PKCS11CertificationRequest(byte[] bytes)
construct a PKCS10 certification request from a DER encoded byte stream.


PKCS11CertificationRequest

public PKCS11CertificationRequest(org.bouncycastle.asn1.ASN1Sequence sequence)

PKCS11CertificationRequest

public PKCS11CertificationRequest(iaik.pkcs.pkcs11.Session session,
                                  iaik.pkcs.pkcs11.Mechanism mechanism,
                                  org.bouncycastle.asn1.x509.X509Name subject,
                                  java.security.PublicKey key,
                                  org.bouncycastle.asn1.ASN1Set attributes,
                                  iaik.pkcs.pkcs11.objects.PrivateKey signingKey)
                           throws java.security.NoSuchAlgorithmException,
                                  java.security.NoSuchProviderException,
                                  java.security.InvalidKeyException,
                                  java.security.SignatureException,
                                  iaik.pkcs.pkcs11.TokenException,
                                  java.io.IOException
create a PKCS10 certfication request using the given pkcs11 private key

Throws:
iaik.pkcs.pkcs11.TokenException
java.io.IOException
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException
java.security.InvalidKeyException
java.security.SignatureException
Method Detail

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

Overrides:
getEncoded in class org.bouncycastle.asn1.ASN1Encodable

getPKCS10CertificationRequest

public org.bouncycastle.jce.PKCS10CertificationRequest getPKCS10CertificationRequest()
Returns:
a PKCS10CertificateRequest representation of this data.