Package org.bouncycastle.pkcs
Class PKCS10CertificationRequest
java.lang.Object
org.bouncycastle.pkcs.PKCS10CertificationRequest
- Direct Known Subclasses:
BcPKCS10CertificationRequest,JcaPKCS10CertificationRequest
Holding class for a PKCS#10 certification request.
-
Constructor Summary
ConstructorsConstructorDescriptionPKCS10CertificationRequest(byte[] encoded) Create a PKCS10CertificationRequest from the passed in bytes.PKCS10CertificationRequest(CertificationRequest certificationRequest) Create a PKCS10CertificationRequest from an underlying ASN.1 structure. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturn the attributes, if any associated with this request.Return an array of attributes matching the passed in type OID.byte[]Return any extensions requested in the PKCS#10 request.byte[]Return the bytes making up the signature associated with this request.Return the details of the signature algorithm used to create this request.Return the subject on this request.Return the SubjectPublicKeyInfo describing the public key this request is carrying.booleanReturn true if the certification request has an alternate public key present.inthashCode()booleanisAltSignatureValid(ContentVerifierProvider verifierProvider) Validate the alternate signature on the PKCS10 certification request in this holder.booleanisSignatureValid(ContentVerifierProvider verifierProvider) Validate the signature on the PKCS10 certification request in this holder.Return the underlying ASN.1 structure for this request.
-
Constructor Details
-
PKCS10CertificationRequest
Create a PKCS10CertificationRequest from an underlying ASN.1 structure.- Parameters:
certificationRequest- the underlying ASN.1 structure representing a request.
-
PKCS10CertificationRequest
Create a PKCS10CertificationRequest from the passed in bytes.- Parameters:
encoded- BER/DER encoding of the CertificationRequest structure.- Throws:
IOException- in the event of corrupted data, or an incorrect structure.
-
-
Method Details
-
toASN1Structure
Return the underlying ASN.1 structure for this request.- Returns:
- a CertificateRequest object.
-
getSubject
Return the subject on this request.- Returns:
- the X500Name representing the request's subject.
-
getSignatureAlgorithm
Return the details of the signature algorithm used to create this request.- Returns:
- the AlgorithmIdentifier describing the signature algorithm used to create this request.
-
getSignature
public byte[] getSignature()Return the bytes making up the signature associated with this request.- Returns:
- the request signature bytes.
-
getSubjectPublicKeyInfo
Return the SubjectPublicKeyInfo describing the public key this request is carrying.- Returns:
- the public key ASN.1 structure contained in the request.
-
getAttributes
Return the attributes, if any associated with this request.- Returns:
- an array of Attribute, zero length if none present.
-
getAttributes
Return an array of attributes matching the passed in type OID.- Parameters:
type- the type of the attribute being looked for.- Returns:
- an array of Attribute of the requested type, zero length if none present.
-
getEncoded
- Throws:
IOException
-
isSignatureValid
Validate the signature on the PKCS10 certification request in this holder.- Parameters:
verifierProvider- a ContentVerifierProvider that can generate a verifier for the signature.- Returns:
- true if the signature is valid, false otherwise.
- Throws:
PKCSException- if the signature cannot be processed or is inappropriate.
-
hasAltPublicKey
public boolean hasAltPublicKey()Return true if the certification request has an alternate public key present.- Returns:
- true if this is a dual key request, false otherwise.
-
isAltSignatureValid
Validate the alternate signature on the PKCS10 certification request in this holder.- Parameters:
verifierProvider- a ContentVerifierProvider that can generate a verifier for the signature.- Returns:
- true if the alternate signature is valid, false otherwise.
- Throws:
PKCSException- if the signature cannot be processed or is inappropriate.
-
getRequestedExtensions
Return any extensions requested in the PKCS#10 request. If none are present, the method will return null.- Returns:
- the requested extensions, null if none are requested.
- Throws:
IllegalStateException- if the extension request is and is somehow invalid.
-
equals
-
hashCode
public int hashCode()
-