@Test(expectedExceptions = CertificateExpiredException.class) public void testLoadFiles_invalidCert() throws Exception { new PKSigningInformationUtil().loadSigningInformationFromPKCS12AndIntermediateCertificate(KEYSTORE_PATH_EXPIRED, KEYSTORE_PASSWORD_EXPIRED, APPLE_WWDRCA); }
public PKSigningInformation loadSigningInformationFromPKCS12AndIntermediateCertificate(final String keyPath,final String keyPassword, final String appleWWDRCAFilePath) throws IOException, CertificateException { try (InputStream walletCertStream = CertUtils.toInputStream(keyPath); InputStream appleWWDRCertStream = CertUtils.toInputStream(appleWWDRCAFilePath)) { KeyStore pkcs12KeyStore = loadPKCS12File(walletCertStream, keyPassword); X509Certificate appleWWDRCert = loadDERCertificate(appleWWDRCertStream); return loadSigningInformation(pkcs12KeyStore, keyPassword, appleWWDRCert); } }
PKSigningInformationUtil { public PKSigningInformation loadSigningInformationFromPKCS12AndIntermediateCertificate(final String keyPath,final String keyPassword, final String appleWWDRCAFilePath) throws IOException, CertificateException { try (InputStream walletCertStream = CertUtils.toInputStream(keyPath); InputStream appleWWDRCertStream = CertUtils.toInputStream(appleWWDRCAFilePath)) { KeyStore pkcs12KeyStore = loadPKCS12File(walletCertStream, keyPassword); X509Certificate appleWWDRCert = loadDERCertificate(appleWWDRCertStream); return loadSigningInformation(pkcs12KeyStore, keyPassword, appleWWDRCert); } } }
PKSigningInformationUtil { public PKSigningInformation loadSigningInformationFromPKCS12AndIntermediateCertificate(final String keyPath,final String keyPassword, final String appleWWDRCAFilePath) throws IOException, CertificateException { try (InputStream walletCertStream = CertUtils.toInputStream(keyPath); InputStream appleWWDRCertStream = CertUtils.toInputStream(appleWWDRCAFilePath)) { KeyStore pkcs12KeyStore = loadPKCS12File(walletCertStream, keyPassword); X509Certificate appleWWDRCert = loadDERCertificate(appleWWDRCertStream); return loadSigningInformation(pkcs12KeyStore, keyPassword, appleWWDRCert); } }  }
PKSigningInformationUtil { public PKSigningInformation loadSigningInformationFromPKCS12AndIntermediateCertificate(final String keyPath,final String keyPassword, final String appleWWDRCAFilePath) throws IOException, CertificateException { try (InputStream walletCertStream = CertUtils.toInputStream(keyPath); InputStream appleWWDRCertStream = CertUtils.toInputStream(appleWWDRCAFilePath)) { KeyStore pkcs12KeyStore = loadPKCS12File(walletCertStream, keyPassword); X509Certificate appleWWDRCert = loadDERCertificate(appleWWDRCertStream); return loadSigningInformation(pkcs12KeyStore, keyPassword, appleWWDRCert); } }  PKSigningInformation loadSigningInformation(final String keyStoreFilePath,
                                                       final String keyStorePassword,
                                                       final String appleWWDRCAFilePath); PKSigningInformation loadSigningInformationFromPKCS12AndIntermediateCertificate(final String keyPath,final String keyPassword, final String appleWWDRCAFilePath); PKSigningInformation loadSigningInformationFromPKCS12AndIntermediateCertificate(InputStream keyStoreInputStream,
            String keyStorePassword, InputStream appleWWDRCAFileInputStream); @Deprecated KeyStore loadPKCS12File(String pathToP12, String password); @Deprecated KeyStore loadPKCS12File(InputStream inputStreamOfP12, String password); @Deprecated X509Certificate loadDERCertificate(String filePath); @Deprecated X509Certificate loadDERCertificate(InputStream certificateInputStream); }
PKSigningInformationUtil { public PKSigningInformation loadSigningInformationFromPKCS12AndIntermediateCertificate(final String keyPath,final String keyPassword, final String appleWWDRCAFilePath) throws IOException, CertificateException { try (InputStream walletCertStream = CertUtils.toInputStream(keyPath); InputStream appleWWDRCertStream = CertUtils.toInputStream(appleWWDRCAFilePath)) { KeyStore pkcs12KeyStore = loadPKCS12File(walletCertStream, keyPassword); X509Certificate appleWWDRCert = loadDERCertificate(appleWWDRCertStream); return loadSigningInformation(pkcs12KeyStore, keyPassword, appleWWDRCert); } }  PKSigningInformation loadSigningInformation(final String keyStoreFilePath,
                                                       final String keyStorePassword,
                                                       final String appleWWDRCAFilePath); PKSigningInformation loadSigningInformationFromPKCS12AndIntermediateCertificate(final String keyPath,final String keyPassword, final String appleWWDRCAFilePath); PKSigningInformation loadSigningInformationFromPKCS12AndIntermediateCertificate(InputStream keyStoreInputStream,
            String keyStorePassword, InputStream appleWWDRCAFileInputStream); @Deprecated KeyStore loadPKCS12File(String pathToP12, String password); @Deprecated KeyStore loadPKCS12File(InputStream inputStreamOfP12, String password); @Deprecated X509Certificate loadDERCertificate(String filePath); @Deprecated X509Certificate loadDERCertificate(InputStream certificateInputStream);  }