public X509Certificate loadCertificate ( InputStream in ) throws IOException , GeneralSecurityException { ASN1InputStream derin = new ASN1InputStream ( in ) ; ASN1Primitive certInfo = derin . readObject ( ) ; ASN1Sequence seq = ASN1Sequence . getInstance ( certInfo ) ; return new X509CertificateObject ( Certificate . getInstance ( seq ) ) ; }
Loads a X509 certificate from the specified input stream . Input stream must contain DER - encoded certificate .