private PkiVerificationData(@Nullable String displayName, PublicKey merchantSigningKey, TrustAnchor rootAuthority) throws PaymentProtocolException.PkiVerificationException { try { this.displayName = displayName; this.merchantSigningKey = merchantSigningKey; this.rootAuthority = rootAuthority; this.rootAuthorityName = X509Utils.getDisplayNameFromCertificate(rootAuthority.getTrustedCert(), true); } catch (CertificateParsingException x) { throw new PaymentProtocolException.PkiVerificationException(x); } }
@Override public KeyStore getKeyStore() throws FileNotFoundException, KeyStoreException { return X509Utils.loadKeyStore(DEFAULT_KEYSTORE_TYPE, DEFAULT_KEYSTORE_PASSWORD, new FileInputStream(path)); } }
private PkiVerificationData(@Nullable String displayName, PublicKey merchantSigningKey, TrustAnchor rootAuthority) throws PaymentProtocolException.PkiVerificationException { try { this.displayName = displayName; this.merchantSigningKey = merchantSigningKey; this.rootAuthority = rootAuthority; this.rootAuthorityName = X509Utils.getDisplayNameFromCertificate(rootAuthority.getTrustedCert(), true); } catch (CertificateParsingException x) { throw new PaymentProtocolException.PkiVerificationException(x); } }
@Override public KeyStore getKeyStore() throws FileNotFoundException, KeyStoreException { return X509Utils.loadKeyStore(DEFAULT_KEYSTORE_TYPE, DEFAULT_KEYSTORE_PASSWORD, new FileInputStream(path)); } }
private PkiVerificationData(@Nullable String displayName, PublicKey merchantSigningKey, TrustAnchor rootAuthority) throws PaymentProtocolException.PkiVerificationException { try { this.displayName = displayName; this.merchantSigningKey = merchantSigningKey; this.rootAuthority = rootAuthority; this.rootAuthorityName = X509Utils.getDisplayNameFromCertificate(rootAuthority.getTrustedCert(), true); } catch (CertificateParsingException x) { throw new PaymentProtocolException.PkiVerificationException(x); } }
@Override public KeyStore getKeyStore() throws FileNotFoundException, KeyStoreException { return X509Utils.loadKeyStore(DEFAULT_KEYSTORE_TYPE, DEFAULT_KEYSTORE_PASSWORD, new FileInputStream(path)); } }
private PkiVerificationData(@Nullable String displayName, PublicKey merchantSigningKey, TrustAnchor rootAuthority) throws PaymentProtocolException.PkiVerificationException { try { this.displayName = displayName; this.merchantSigningKey = merchantSigningKey; this.rootAuthority = rootAuthority; this.rootAuthorityName = X509Utils.getDisplayNameFromCertificate(rootAuthority.getTrustedCert(), true); } catch (CertificateParsingException x) { throw new PaymentProtocolException.PkiVerificationException(x); } }
@Override public KeyStore getKeyStore() throws FileNotFoundException, KeyStoreException { return X509Utils.loadKeyStore(DEFAULT_KEYSTORE_TYPE, DEFAULT_KEYSTORE_PASSWORD, new FileInputStream(path)); } }
private PkiVerificationData(@Nullable String displayName, PublicKey merchantSigningKey, TrustAnchor rootAuthority) throws PaymentProtocolException.PkiVerificationException { try { this.displayName = displayName; this.merchantSigningKey = merchantSigningKey; this.rootAuthority = rootAuthority; this.rootAuthorityName = X509Utils.getDisplayNameFromCertificate(rootAuthority.getTrustedCert(), true); } catch (CertificateParsingException x) { throw new PaymentProtocolException.PkiVerificationException(x); } }
private KeyStore loadFallbackStore() throws FileNotFoundException, KeyStoreException { return X509Utils.loadKeyStore("JKS", DEFAULT_KEYSTORE_PASSWORD, getClass().getResourceAsStream("cacerts")); } }
@Test public void testDisplayName() throws Exception { CertificateFactory cf = CertificateFactory.getInstance("X.509"); X509Certificate clientCert = (X509Certificate) cf.generateCertificate(getClass().getResourceAsStream( "startssl-client.crt")); assertEquals("Andreas Schildbach", X509Utils.getDisplayNameFromCertificate(clientCert, false)); X509Certificate comodoCert = (X509Certificate) cf.generateCertificate(getClass().getResourceAsStream( "comodo-smime.crt")); assertEquals("comodo.com@schildbach.de", X509Utils.getDisplayNameFromCertificate(comodoCert, true)); } }
private KeyStore loadFallbackStore() throws FileNotFoundException, KeyStoreException { return X509Utils.loadKeyStore("JKS", DEFAULT_KEYSTORE_PASSWORD, getClass().getResourceAsStream("cacerts")); } }
String displayName = X509Utils.getDisplayNameFromCertificate(cert, true); if (displayName == null) throw new PaymentProtocolException.PkiVerificationException("Could not extract name from certificate");
private KeyStore loadFallbackStore() throws FileNotFoundException, KeyStoreException { return X509Utils.loadKeyStore("JKS", DEFAULT_KEYSTORE_PASSWORD, getClass().getResourceAsStream("cacerts")); } }
String displayName = X509Utils.getDisplayNameFromCertificate(cert, true); if (displayName == null) throw new PaymentProtocolException.PkiVerificationException("Could not extract name from certificate");
private KeyStore loadFallbackStore() throws FileNotFoundException, KeyStoreException { return X509Utils.loadKeyStore("JKS", DEFAULT_KEYSTORE_PASSWORD, getClass().getResourceAsStream("cacerts")); } }
String displayName = X509Utils.getDisplayNameFromCertificate(cert, true); if (displayName == null) throw new PaymentProtocolException.PkiVerificationException("Could not extract name from certificate");
return X509Utils.loadKeyStore(keystoreType, DEFAULT_KEYSTORE_PASSWORD, new FileInputStream(keystorePath)); } catch (FileNotFoundException e) {
String displayName = X509Utils.getDisplayNameFromCertificate(cert, true); if (displayName == null) throw new PaymentProtocolException.PkiVerificationException("Could not extract name from certificate");
return X509Utils.loadKeyStore(keystoreType, DEFAULT_KEYSTORE_PASSWORD, new FileInputStream(keystorePath)); } catch (FileNotFoundException e) {