@Override public byte[] getTBSCertificate() throws CertificateEncodingException { return mDelegate.getTBSCertificate(); }
@Override public byte[] getTBSCertificate() throws CertificateEncodingException { return unwrap().getTBSCertificate(); }
@Override public byte[] getTBSCertificate() throws CertificateEncodingException { return unwrap().getTBSCertificate(); }
@Override public byte[] getTBSCertificate() throws CertificateEncodingException { return unwrap().getTBSCertificate(); }
private KeyTransRecipientInfo computeRecipientInfo(X509Certificate x509certificate, byte[] abyte0) throws IOException, CertificateEncodingException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException { TBSCertificate certificate; try (ASN1InputStream input = new ASN1InputStream(x509certificate.getTBSCertificate())) { certificate = TBSCertificate.getInstance(input.readObject()); } AlgorithmIdentifier algorithmId = certificate.getSubjectPublicKeyInfo().getAlgorithm(); IssuerAndSerialNumber serial = new IssuerAndSerialNumber( certificate.getIssuer(), certificate.getSerialNumber().getValue()); Cipher cipher; try { cipher = Cipher.getInstance(algorithmId.getAlgorithm().getId(), SecurityProvider.getProvider()); } catch (NoSuchAlgorithmException | NoSuchPaddingException e) { // should never happen, if this happens throw IOException instead throw new RuntimeException("Could not find a suitable javax.crypto provider", e); } cipher.init(1, x509certificate.getPublicKey()); DEROctetString octets = new DEROctetString(cipher.doFinal(abyte0)); RecipientIdentifier recipientId = new RecipientIdentifier(serial); return new KeyTransRecipientInfo(recipientId, algorithmId, octets); }
@Override /** * {@inheritDoc} */ public byte[] getTBSCertificate() throws CertificateEncodingException { return internalCert.getTBSCertificate(); }
private static void createTemporaryCertFile(X509Certificate cert, File outputFile) throws Exception { try (FileOutputStream fos = new FileOutputStream(outputFile)){ fos.write(cert.getTBSCertificate()); } }
private static void createTemporaryCertFile(X509Certificate cert, File outputFile) throws Exception { try (FileOutputStream fos = new FileOutputStream(outputFile)){ fos.write(cert.getTBSCertificate()); } }
URL url = new URL("https://www.google.com/"); HttpsURLConnection con = (HttpsURLConnection) url.openConnection(); con.connect(); Certificate userCert[] = con.getServerCertificates(); X509Certificate x509cert = ((X509Certificate) userCert[0]); byte[] tbs=x509cert.getTBSCertificate();
@Override public byte[] getTBSCertificate() throws CertificateEncodingException { return unwrap().getTBSCertificate(); }
@Override public byte[] getTBSCertificate() throws CertificateEncodingException { return unwrap().getTBSCertificate(); }
@Override public byte[] getTBSCertificate() throws CertificateEncodingException { return unwrap().getTBSCertificate(); }
@Override public byte[] getTBSCertificate() throws CertificateEncodingException { return unwrap().getTBSCertificate(); }
@Override public byte[] getTBSCertificate() throws CertificateEncodingException { return unwrap().getTBSCertificate(); }
@Override public byte[] getTBSCertificate() throws CertificateEncodingException { return unwrap().getTBSCertificate(); }
@Override public byte[] getTBSCertificate() throws CertificateEncodingException { return unwrap().getTBSCertificate(); }
/** * Get the issuer fields from an X509 Certificate * @param cert an X509Certificate * @return an X500Name */ public static X500Name getIssuerFields(X509Certificate cert) { try { return new X500Name((ASN1Sequence)CertificateInfo.getIssuer(cert.getTBSCertificate())); } catch (Exception e) { throw new ExceptionConverter(e); } }
/** * Get the subject fields from an X509 Certificate * @param cert an X509Certificate * @return an X509Name */ public static X509Name getSubjectFields(final X509Certificate cert) { try { return new X509Name((ASN1Sequence)getSubject(cert.getTBSCertificate())); } catch (final Exception e) { throw new ExceptionConverter(e); } }
/** * Get the issuer fields from an X509 Certificate * @param cert an X509Certificate * @return an X509Name */ public static X509Name getIssuerFields(X509Certificate cert) { try { return new X509Name((ASN1Sequence)getIssuer(cert.getTBSCertificate())); } catch (Exception e) { throw new ExceptionConverter(e); } }
public void testGetObject_validObjectEncoding() throws Exception { // load cert final X509Certificate cert = TestUtils.loadCertificate("CernerDirect DevCert Provider CA.der"); // use a concreate class and check for key usage final SignatureAlgorithmField field = new SignatureAlgorithmField(); assertNotNull(field.getDERObject(cert.getTBSCertificate())); }