Bouncy Castle Cryptography Library 1.46

org.bouncycastle.pkcs
Class PKCS10CertificationRequestBuilder

java.lang.Object
  extended by org.bouncycastle.pkcs.PKCS10CertificationRequestBuilder
Direct Known Subclasses:
JcaPKCS10CertificationRequestBuilder

public class PKCS10CertificationRequestBuilder
extends java.lang.Object

A class for creating PKCS#10 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})
  }
 


Constructor Summary
PKCS10CertificationRequestBuilder(org.bouncycastle.asn1.x500.X500Name subject, org.bouncycastle.asn1.x509.SubjectPublicKeyInfo publicKeyInfo)
          Basic constructor.
 
Method Summary
 PKCS10CertificationRequestBuilder addAttribute(org.bouncycastle.asn1.ASN1ObjectIdentifier attrType, org.bouncycastle.asn1.ASN1Encodable attrValue)
          Add an attribute to the certification request we are building.
 PKCS10CertificationRequestBuilder addAttribute(org.bouncycastle.asn1.ASN1ObjectIdentifier attrType, org.bouncycastle.asn1.ASN1Encodable[] attrValues)
          Add an attribute with multiple values to the certification request we are building.
 PKCS10CertificationRequestHolder build(ContentSigner signer)
          Generate an PKCS#10 request based on the past in signer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PKCS10CertificationRequestBuilder

public PKCS10CertificationRequestBuilder(org.bouncycastle.asn1.x500.X500Name subject,
                                         org.bouncycastle.asn1.x509.SubjectPublicKeyInfo publicKeyInfo)
Basic constructor.

Parameters:
subject - the X.500 Name defining the certificate subject this request is for.
publicKeyInfo - the info structure for the public key to be associated with this subject.
Method Detail

addAttribute

public PKCS10CertificationRequestBuilder addAttribute(org.bouncycastle.asn1.ASN1ObjectIdentifier attrType,
                                                      org.bouncycastle.asn1.ASN1Encodable attrValue)
Add an attribute to the certification request we are building.

Parameters:
attrType - the OID giving the type of the attribute.
attrValue - the ASN.1 structure that forms the value of the attribute.
Returns:
this builder object.

addAttribute

public PKCS10CertificationRequestBuilder addAttribute(org.bouncycastle.asn1.ASN1ObjectIdentifier attrType,
                                                      org.bouncycastle.asn1.ASN1Encodable[] attrValues)
Add an attribute with multiple values to the certification request we are building.

Parameters:
attrType - the OID giving the type of the attribute.
attrValues - an array of ASN.1 structures that form the value of the attribute.
Returns:
this builder object.

build

public PKCS10CertificationRequestHolder build(ContentSigner signer)
Generate an PKCS#10 request based on the past in signer.

Parameters:
signer - the content signer to be used to generate the signature validating the certificate.
Returns:
a holder containing the resulting PKCS#10 certification request.

Bouncy Castle Cryptography Library 1.46