public static CertificationRequest getInstance(Object o) { if (o instanceof CertificationRequest) { return (CertificationRequest)o; } if (o != null) { return new CertificationRequest(ASN1Sequence.getInstance(o)); } return null; }
/** * Return the SubjectPublicKeyInfo describing the public key this request is carrying. * * @return the public key ASN.1 structure contained in the request. */ public SubjectPublicKeyInfo getSubjectPublicKeyInfo() { return certificationRequest.getCertificationRequestInfo().getSubjectPublicKeyInfo(); }
public byte[] getEncoded() throws IOException { return certificationRequest.getEncoded(); }
private static CertificationRequest parseBytes(byte[] encoding) throws IOException { try { return CertificationRequest.getInstance(ASN1Primitive.fromByteArray(encoding)); } catch (ClassCastException e) { throw new PKCSIOException("malformed data: " + e.getMessage(), e); } catch (IllegalArgumentException e) { throw new PKCSIOException("malformed data: " + e.getMessage(), e); } }
/** * Validate the signature on the PKCS10 certification request in this holder. * * @param verifierProvider a ContentVerifierProvider that can generate a verifier for the signature. * @return true if the signature is valid, false otherwise. * @throws PKCSException if the signature cannot be processed or is inappropriate. */ public boolean isSignatureValid(ContentVerifierProvider verifierProvider) throws PKCSException { CertificationRequestInfo requestInfo = certificationRequest.getCertificationRequestInfo(); ContentVerifier verifier; try { verifier = verifierProvider.get(certificationRequest.getSignatureAlgorithm()); OutputStream sOut = verifier.getOutputStream(); sOut.write(requestInfo.getEncoded(ASN1Encoding.DER)); sOut.close(); } catch (Exception e) { throw new PKCSException("unable to process signature: " + e.getMessage(), e); } return verifier.verify(this.getSignature()); }
/** * Return the details of the signature algorithm used to create this request. * * @return the AlgorithmIdentifier describing the signature algorithm used to create this request. */ public AlgorithmIdentifier getSignatureAlgorithm() { return certificationRequest.getSignatureAlgorithm(); }
public int hashCode() { return this.toASN1Structure().hashCode(); } }
/** * Return the bytes making up the signature associated with this request. * * @return the request signature bytes. */ public byte[] getSignature() { return certificationRequest.getSignature().getOctets(); }
public boolean equals(Object o) { if (o == this) { return true; } if (!(o instanceof PKCS10CertificationRequest)) { return false; } PKCS10CertificationRequest other = (PKCS10CertificationRequest)o; return this.toASN1Structure().equals(other.toASN1Structure()); }
private static CertificationRequest parseBytes(byte[] encoding) throws IOException { try { return CertificationRequest.getInstance(ASN1Primitive.fromByteArray(encoding)); } catch (ClassCastException e) { throw new PKCSIOException("malformed data: " + e.getMessage(), e); } catch (IllegalArgumentException e) { throw new PKCSIOException("malformed data: " + e.getMessage(), e); } }
/** * Validate the signature on the PKCS10 certification request in this holder. * * @param verifierProvider a ContentVerifierProvider that can generate a verifier for the signature. * @return true if the signature is valid, false otherwise. * @throws PKCSException if the signature cannot be processed or is inappropriate. */ public boolean isSignatureValid(ContentVerifierProvider verifierProvider) throws PKCSException { CertificationRequestInfo requestInfo = certificationRequest.getCertificationRequestInfo(); ContentVerifier verifier; try { verifier = verifierProvider.get(certificationRequest.getSignatureAlgorithm()); OutputStream sOut = verifier.getOutputStream(); sOut.write(requestInfo.getEncoded(ASN1Encoding.DER)); sOut.close(); } catch (Exception e) { throw new PKCSException("unable to process signature: " + e.getMessage(), e); } return verifier.verify(this.getSignature()); }
/** * Return the details of the signature algorithm used to create this request. * * @return the AlgorithmIdentifier describing the signature algorithm used to create this request. */ public AlgorithmIdentifier getSignatureAlgorithm() { return certificationRequest.getSignatureAlgorithm(); }
public int hashCode() { return this.toASN1Structure().hashCode(); } }
/** * Return the bytes making up the signature associated with this request. * * @return the request signature bytes. */ public byte[] getSignature() { return certificationRequest.getSignature().getOctets(); }
public boolean equals(Object o) { if (o == this) { return true; } if (!(o instanceof PKCS10CertificationRequest)) { return false; } PKCS10CertificationRequest other = (PKCS10CertificationRequest)o; return this.toASN1Structure().equals(other.toASN1Structure()); }
public static CertificationRequest getInstance(Object o) { if (o instanceof CertificationRequest) { return (CertificationRequest)o; } if (o != null) { return new CertificationRequest(ASN1Sequence.getInstance(o)); } return null; }
return CertRepMessage.getInstance(o); case TYPE_P10_CERT_REQ: return CertificationRequest.getInstance(o); case TYPE_POPO_CHALL: return POPODecKeyChallContent.getInstance(o);
/** * Return the SubjectPublicKeyInfo describing the public key this request is carrying. * * @return the public key ASN.1 structure contained in the request. */ public SubjectPublicKeyInfo getSubjectPublicKeyInfo() { return certificationRequest.getCertificationRequestInfo().getSubjectPublicKeyInfo(); }
public byte[] getEncoded() throws IOException { return certificationRequest.getEncoded(); }
return new PKCS10CertificationRequest(new CertificationRequest(info, signer.getAlgorithmIdentifier(), new DERBitString(signer.getSignature())));