org.apache.geronimo.util.jce
Class PKCS10CertificationRequest

java.lang.Object
  extended by org.apache.geronimo.util.asn1.ASN1Encodable
      extended by org.apache.geronimo.util.asn1.pkcs.CertificationRequest
          extended by org.apache.geronimo.util.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 inherited from class org.apache.geronimo.util.asn1.pkcs.CertificationRequest
reqInfo, sigAlgId, sigBits
 
Constructor Summary
PKCS10CertificationRequest(ASN1Sequence sequence)
           
PKCS10CertificationRequest(byte[] bytes)
          construct a PKCS10 certification request from a DER encoded byte stream.
PKCS10CertificationRequest(String signatureAlgorithm, X500Principal subject, PublicKey key, ASN1Set attributes, PrivateKey signingKey)
          create a PKCS10 certfication request using the BC provider.
PKCS10CertificationRequest(String signatureAlgorithm, X500Principal subject, PublicKey key, ASN1Set attributes, PrivateKey signingKey, String provider)
          create a PKCS10 certfication request using the named provider.
PKCS10CertificationRequest(String signatureAlgorithm, X509Name subject, PublicKey key, ASN1Set attributes, PrivateKey signingKey)
          create a PKCS10 certfication request using the BC provider.
PKCS10CertificationRequest(String signatureAlgorithm, X509Name subject, PublicKey key, ASN1Set attributes, PrivateKey signingKey, String provider)
          create a PKCS10 certfication request using the named provider.
 
Method Summary
 byte[] getEncoded()
          return a DER encoded byte array representing this object
 PublicKey getPublicKey()
          return the public key associated with the certification request - the public key is created using the BC provider.
 PublicKey getPublicKey(String provider)
           
 boolean verify()
          verify the request using the BC provider.
 boolean verify(String provider)
           
 
Methods inherited from class org.apache.geronimo.util.asn1.pkcs.CertificationRequest
getCertificationRequestInfo, getSignature, getSignatureAlgorithm, toASN1Object
 
Methods inherited from class org.apache.geronimo.util.asn1.ASN1Encodable
equals, getDERObject, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

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(String signatureAlgorithm,
                                  X509Name subject,
                                  PublicKey key,
                                  ASN1Set attributes,
                                  PrivateKey signingKey)
                           throws NoSuchAlgorithmException,
                                  NoSuchProviderException,
                                  InvalidKeyException,
                                  SignatureException
create a PKCS10 certfication request using the BC provider.

Throws:
NoSuchAlgorithmException
NoSuchProviderException
InvalidKeyException
SignatureException

PKCS10CertificationRequest

public PKCS10CertificationRequest(String signatureAlgorithm,
                                  X500Principal subject,
                                  PublicKey key,
                                  ASN1Set attributes,
                                  PrivateKey signingKey)
                           throws NoSuchAlgorithmException,
                                  NoSuchProviderException,
                                  InvalidKeyException,
                                  SignatureException
create a PKCS10 certfication request using the BC provider.

Throws:
NoSuchAlgorithmException
NoSuchProviderException
InvalidKeyException
SignatureException

PKCS10CertificationRequest

public PKCS10CertificationRequest(String signatureAlgorithm,
                                  X500Principal subject,
                                  PublicKey key,
                                  ASN1Set attributes,
                                  PrivateKey signingKey,
                                  String provider)
                           throws NoSuchAlgorithmException,
                                  NoSuchProviderException,
                                  InvalidKeyException,
                                  SignatureException
create a PKCS10 certfication request using the named provider.

Throws:
NoSuchAlgorithmException
NoSuchProviderException
InvalidKeyException
SignatureException

PKCS10CertificationRequest

public PKCS10CertificationRequest(String signatureAlgorithm,
                                  X509Name subject,
                                  PublicKey key,
                                  ASN1Set attributes,
                                  PrivateKey signingKey,
                                  String provider)
                           throws NoSuchAlgorithmException,
                                  NoSuchProviderException,
                                  InvalidKeyException,
                                  SignatureException
create a PKCS10 certfication request using the named provider.

Throws:
NoSuchAlgorithmException
NoSuchProviderException
InvalidKeyException
SignatureException
Method Detail

getPublicKey

public PublicKey getPublicKey()
                       throws NoSuchAlgorithmException,
                              NoSuchProviderException,
                              InvalidKeyException
return the public key associated with the certification request - the public key is created using the BC provider.

Throws:
NoSuchAlgorithmException
NoSuchProviderException
InvalidKeyException

getPublicKey

public PublicKey getPublicKey(String provider)
                       throws NoSuchAlgorithmException,
                              NoSuchProviderException,
                              InvalidKeyException
Throws:
NoSuchAlgorithmException
NoSuchProviderException
InvalidKeyException

verify

public boolean verify()
               throws NoSuchAlgorithmException,
                      NoSuchProviderException,
                      InvalidKeyException,
                      SignatureException
verify the request using the BC provider.

Throws:
NoSuchAlgorithmException
NoSuchProviderException
InvalidKeyException
SignatureException

verify

public boolean verify(String provider)
               throws NoSuchAlgorithmException,
                      NoSuchProviderException,
                      InvalidKeyException,
                      SignatureException
Throws:
NoSuchAlgorithmException
NoSuchProviderException
InvalidKeyException
SignatureException

getEncoded

public byte[] getEncoded()
return a DER encoded byte array representing this object

Overrides:
getEncoded in class ASN1Encodable


Copyright © 2003-2007 Apache Software Foundation. All Rights Reserved.