Top Description Fields Constructors Methods
org.bouncycastle.pkcs

public Class PKCS10CertificationRequest

extends Object
Class Inheritance
Known Direct Subclasses
org.bouncycastle.pkcs.jcajce.JcaPKCS10CertificationRequest
Imports
java.io.IOException, .OutputStream, java.util.ArrayList, .Enumeration, .List, org.bouncycastle.asn1.ASN1Boolean, .ASN1Encoding, .ASN1ObjectIdentifier, .ASN1OctetString, .ASN1Primitive, .ASN1Sequence, .ASN1Set, org.bouncycastle.asn1.pkcs.Attribute, .CertificationRequest, .CertificationRequestInfo, .PKCSObjectIdentifiers, org.bouncycastle.asn1.x500.X500Name, org.bouncycastle.asn1.x509.AlgorithmIdentifier, .Extensions, .ExtensionsGenerator, .SubjectPublicKeyInfo, org.bouncycastle.operator.ContentVerifier, .ContentVerifierProvider, org.bouncycastle.pkix.SubjectPublicKeyInfoChecker

Holding class for a PKCS#10 certification request.

Field Summary

Modifier and TypeField and Description
private CertificationRequest
private static Attribute[]

Constructor Summary

AccessConstructor and Description
public
PKCS10CertificationRequest(CertificationRequest
the underlying ASN.1 structure representing a request.
certificationRequest
)

Create a PKCS10CertificationRequestHolder from an underlying ASN.1 structure.

public
PKCS10CertificationRequest(byte[]
BER/DER encoding of the CertificationRequest structure.
encoded
)

Create a PKCS10CertificationRequestHolder from the passed in bytes.

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public Attribute[]

Returns:

an array of Attribute, zero length if none present.
getAttributes
()

Return the attributes, if any associated with this request.

public Attribute[]

Returns:

an array of Attribute of the requested type, zero length if none present.
getAttributes
(ASN1ObjectIdentifier
the type of the attribute being looked for.
type
)

Return an array of attributes matching the passed in type OID.

public byte[]
public Extensions
public byte[]

Returns:

the request signature bytes.
getSignature
()

Return the bytes making up the signature associated with this request.

public AlgorithmIdentifier

Returns:

the AlgorithmIdentifier describing the signature algorithm used to create this request.
getSignatureAlgorithm
()

Return the details of the signature algorithm used to create this request.

public X500Name

Returns:

the X500Name representing the request's subject.
getSubject
()

Return the subject on this request.

public SubjectPublicKeyInfo

Returns:

the public key ASN.1 structure contained in the request.
getSubjectPublicKeyInfo
()

Return the SubjectPublicKeyInfo describing the public key this request is carrying.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.
public boolean

Returns:

true if the signature is valid, false otherwise.
isSignatureValid
(ContentVerifierProvider
a ContentVerifierProvider that can generate a verifier for the signature.
verifierProvider
)

Validate the signature on the PKCS10 certification request in this holder.

private static CertificationRequest
parseBytes(byte[] encoding)

public CertificationRequest

Returns:

a CertificateRequest object.
toASN1Structure
()

Return the underlying ASN.1 structure for this request.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

certificationRequestback to summary
private CertificationRequest certificationRequest
EMPTY_ARRAYback to summary
private static Attribute[] EMPTY_ARRAY

Constructor Detail

PKCS10CertificationRequestback to summary
public PKCS10CertificationRequest(CertificationRequest certificationRequest)

Create a PKCS10CertificationRequestHolder from an underlying ASN.1 structure.

Parameters
certificationRequest:CertificationRequest

the underlying ASN.1 structure representing a request.

PKCS10CertificationRequestback to summary
public PKCS10CertificationRequest(byte[] encoded) throws IOException

Create a PKCS10CertificationRequestHolder from the passed in bytes.

Parameters
encoded:byte[]

BER/DER encoding of the CertificationRequest structure.

Exceptions
IOException:
in the event of corrupted data, or an incorrect structure.

Method Detail

equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

getAttributesback to summary
public Attribute[] getAttributes()

Return the attributes, if any associated with this request.

Returns:Attribute[]

an array of Attribute, zero length if none present.

getAttributesback to summary
public Attribute[] getAttributes(ASN1ObjectIdentifier type)

Return an array of attributes matching the passed in type OID.

Parameters
type:ASN1ObjectIdentifier

the type of the attribute being looked for.

Returns:Attribute[]

an array of Attribute of the requested type, zero length if none present.

getEncodedback to summary
public byte[] getEncoded() throws IOException
getRequestedExtensionsback to summary
public Extensions getRequestedExtensions()
getSignatureback to summary
public byte[] getSignature()

Return the bytes making up the signature associated with this request.

Returns:byte[]

the request signature bytes.

getSignatureAlgorithmback to summary
public AlgorithmIdentifier getSignatureAlgorithm()

Return the details of the signature algorithm used to create this request.

Returns:AlgorithmIdentifier

the AlgorithmIdentifier describing the signature algorithm used to create this request.

getSubjectback to summary
public X500Name getSubject()

Return the subject on this request.

Returns:X500Name

the X500Name representing the request's subject.

getSubjectPublicKeyInfoback to summary
public SubjectPublicKeyInfo getSubjectPublicKeyInfo()

Return the SubjectPublicKeyInfo describing the public key this request is carrying.

Returns:SubjectPublicKeyInfo

the public key ASN.1 structure contained in the request.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

isSignatureValidback to summary
public boolean isSignatureValid(ContentVerifierProvider verifierProvider) throws PKCSException

Validate the signature on the PKCS10 certification request in this holder.

Parameters
verifierProvider:ContentVerifierProvider

a ContentVerifierProvider that can generate a verifier for the signature.

Returns:boolean

true if the signature is valid, false otherwise.

Exceptions
PKCSException:
if the signature cannot be processed or is inappropriate.
parseBytesback to summary
private static CertificationRequest parseBytes(byte[] encoding) throws IOException
toASN1Structureback to summary
public CertificationRequest toASN1Structure()

Return the underlying ASN.1 structure for this request.

Returns:CertificationRequest

a CertificateRequest object.