/** * Base constructor. * * @param cert certificate to be used a the source for the holder creation. * @throws CertificateEncodingException if there is a problem extracting the certificate information. */ public JcaX509CertificateHolder(X509Certificate cert) throws CertificateEncodingException { super(Certificate.getInstance(cert.getEncoded())); } }
/** * Base constructor. * * @param cert certificate to be used a the source for the holder creation. * @throws CertificateEncodingException if there is a problem extracting the certificate information. */ public JcaX509CertificateHolder(X509Certificate cert) throws CertificateEncodingException { super(Certificate.getInstance(cert.getEncoded())); } }
private EncryptedPrivateKeyData createPrivateKeySequence(EncryptedPrivateKeyInfo encryptedPrivateKeyInfo, Certificate[] chain) throws CertificateEncodingException { org.spongycastle.asn1.x509.Certificate[] certChain = new org.spongycastle.asn1.x509.Certificate[chain.length]; for (int i = 0; i != chain.length; i++) { certChain[i] = org.spongycastle.asn1.x509.Certificate.getInstance(chain[i].getEncoded()); } return new EncryptedPrivateKeyData(encryptedPrivateKeyInfo, certChain); }
public static Certificate getInstance( ASN1TaggedObject obj, boolean explicit) { return getInstance(ASN1Sequence.getInstance(obj, explicit)); }
private void readObject( ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); init(Certificate.getInstance(in.readObject())); }
public static Certificate parseCertificate(byte[] encoding) throws IOException { try { return Certificate.getInstance(encoding); } catch (IllegalArgumentException e) { throw new TlsCryptoException("unable to decode certificate: " + e.getMessage(), e); } }
public static Certificate getInstance( ASN1TaggedObject obj, boolean explicit) { return getInstance(ASN1Sequence.getInstance(obj, explicit)); }
static IssuerAndSerialNumber getIssuerAndSerialNumber(X509Certificate cert) throws CertificateEncodingException { Certificate certStruct = Certificate.getInstance(cert.getEncoded()); return new IssuerAndSerialNumber(certStruct.getIssuer(), cert.getSerialNumber()); }
private static Certificate convertCert(X509Certificate certificate) throws IOException { try { return Certificate.getInstance(certificate.getEncoded()); } catch (CertificateEncodingException e) { throw new PKCSIOException("cannot encode certificate: " + e.getMessage(), e); } }
static IssuerAndSerialNumber getIssuerAndSerialNumber(X509Certificate cert) throws CertificateEncodingException { Certificate certStruct = Certificate.getInstance(cert.getEncoded()); return new IssuerAndSerialNumber(certStruct.getIssuer(), cert.getSerialNumber()); }
private static Certificate convertCert(X509Certificate certificate) throws IOException { try { return Certificate.getInstance(certificate.getEncoded()); } catch (CertificateEncodingException e) { throw new PKCSIOException("cannot encode certificate: " + e.getMessage(), e); } }
private Certificate readPEMCertificate( InputStream in) throws IOException, CertificateParsingException { ASN1Sequence seq = PEM_PARSER.readPEMObject(in); if (seq != null) { return new X509CertificateObject( org.spongycastle.asn1.x509.Certificate.getInstance(seq)); } return null; }
/** * Read a X.509 certificate. * * @param decGen the decryptor generator to decrypt the encrypted value. * @return an X509CertificateHolder containing the certificate read. * @throws CRMFException if the decrypted data cannot be parsed, or a decryptor cannot be generated. */ public X509CertificateHolder readCertificateHolder(ValueDecryptorGenerator decGen) throws CRMFException { return new X509CertificateHolder(Certificate.getInstance(decryptValue(decGen))); }
/** * Read a X.509 certificate. * * @param decGen the decryptor generator to decrypt the encrypted value. * @return an X509CertificateHolder containing the certificate read. * @throws CRMFException if the decrypted data cannot be parsed, or a decryptor cannot be generated. */ public X509CertificateHolder readCertificateHolder(ValueDecryptorGenerator decGen) throws CRMFException { return new X509CertificateHolder(Certificate.getInstance(decryptValue(decGen))); }
private static Certificate parseBytes(byte[] certEncoding) throws IOException { try { return Certificate.getInstance(CertUtils.parseNonEmptyASN1(certEncoding)); } catch (ClassCastException e) { throw new CertIOException("malformed data: " + e.getMessage(), e); } catch (IllegalArgumentException e) { throw new CertIOException("malformed data: " + e.getMessage(), e); } }
private static Certificate parseBytes(byte[] certEncoding) throws IOException { try { return Certificate.getInstance(ASN1Primitive.fromByteArray(certEncoding)); } catch (ClassCastException e) { throw new CertIOException("malformed data: " + e.getMessage(), e); } catch (IllegalArgumentException e) { throw new CertIOException("malformed data: " + e.getMessage(), e); } }
public static CMPCertificate getInstance(Object o) { if (o == null || o instanceof CMPCertificate) { return (CMPCertificate)o; } if (o instanceof ASN1Sequence) { return new CMPCertificate(Certificate.getInstance(o)); } if (o instanceof ASN1TaggedObject) { return new CMPCertificate(AttributeCertificate.getInstance(((ASN1TaggedObject)o).getObject())); } throw new IllegalArgumentException("Invalid object: " + o.getClass().getName()); }
private EncryptedPrivateKeyData(ASN1Sequence seq) { encryptedPrivateKeyInfo = EncryptedPrivateKeyInfo.getInstance(seq.getObjectAt(0)); ASN1Sequence certSeq = ASN1Sequence.getInstance(seq.getObjectAt(1)); certificateChain = new Certificate[certSeq.size()]; for (int i = 0; i != certificateChain.length; i++) { certificateChain[i] = Certificate.getInstance(certSeq.getObjectAt(i)); } }
private static Certificate generateStructure(TBSCertificate tbsCert, AlgorithmIdentifier sigAlgId, byte[] signature) { ASN1EncodableVector v = new ASN1EncodableVector(); v.add(tbsCert); v.add(sigAlgId); v.add(new DERBitString(signature)); return Certificate.getInstance(new DERSequence(v)); }
private static Certificate generateStructure(TBSCertificate tbsCert, AlgorithmIdentifier sigAlgId, byte[] signature) { ASN1EncodableVector v = new ASN1EncodableVector(); v.add(tbsCert); v.add(sigAlgId); v.add(new DERBitString(signature)); return Certificate.getInstance(new DERSequence(v)); }