public final class PKSigningUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
byte[] |
createSignedAndZippedPkPassArchive(PKPass pass,
String pathToTemplateDirectory,
PKSigningInformation signingInformation) |
byte[] |
createSignedAndZippedPkPassArchive(PKPass pass,
URL fileUrlOfTemplateDirectory,
PKSigningInformation signingInformation) |
static PKSigningUtil |
getInstance() |
X509Certificate |
loadDERCertificate(InputStream certificateInputStream)
Load a DEAR Certificate from an
InputStream. |
X509Certificate |
loadDERCertificate(String filePath) |
KeyStore |
loadPKCS12File(InputStream inputStreamOfP12,
String password)
Load the keystore from an already opened input stream.
|
KeyStore |
loadPKCS12File(String pathToP12,
String password) |
PKSigningInformation |
loadSigningInformationFromPKCS12AndIntermediateCertificateStreams(InputStream pkcs12KeyStoreInputStream,
String keyStorePassword,
InputStream appleWWDRCAFileInputStream)
Load all signing information necessary for pass generation using two input streams for the key store and the Apple WWDRCA certificate.
|
PKSigningInformation |
loadSigningInformationFromPKCS12FileAndIntermediateCertificateFile(String pkcs12KeyStoreFilePath,
String keyStorePassword,
String appleWWDRCAFilePath) |
void |
signManifestFile(File temporaryPassDirectory,
File manifestJSONFile,
PKSigningInformation signingInformation) |
public static PKSigningUtil getInstance()
public byte[] createSignedAndZippedPkPassArchive(PKPass pass, URL fileUrlOfTemplateDirectory, PKSigningInformation signingInformation) throws Exception
Exceptionpublic byte[] createSignedAndZippedPkPassArchive(PKPass pass, String pathToTemplateDirectory, PKSigningInformation signingInformation) throws Exception
Exceptionpublic void signManifestFile(File temporaryPassDirectory, File manifestJSONFile, PKSigningInformation signingInformation) throws Exception
Exceptionpublic PKSigningInformation loadSigningInformationFromPKCS12FileAndIntermediateCertificateFile(String pkcs12KeyStoreFilePath, String keyStorePassword, String appleWWDRCAFilePath) throws IOException, NoSuchAlgorithmException, CertificateException, KeyStoreException, NoSuchProviderException, UnrecoverableKeyException
public PKSigningInformation loadSigningInformationFromPKCS12AndIntermediateCertificateStreams(InputStream pkcs12KeyStoreInputStream, String keyStorePassword, InputStream appleWWDRCAFileInputStream) throws IOException, NoSuchAlgorithmException, CertificateException, KeyStoreException, NoSuchProviderException, UnrecoverableKeyException
pkcs12KeyStoreInputStream - InputStream of the key storekeyStorePassword - Password used to access the key storeappleWWDRCAFileInputStream - InputStream of the Apple WWDRCA certificate.IOExceptionNoSuchAlgorithmExceptionCertificateExceptionKeyStoreExceptionNoSuchProviderExceptionUnrecoverableKeyExceptionpublic KeyStore loadPKCS12File(String pathToP12, String password) throws IOException, NoSuchAlgorithmException, CertificateException, KeyStoreException, NoSuchProviderException
public KeyStore loadPKCS12File(InputStream inputStreamOfP12, String password) throws IOException, NoSuchAlgorithmException, CertificateException, KeyStoreException, NoSuchProviderException
inputStreamOfP12 - InputStream containing the signing key store.password - Password to access the key storeinputStreamOfP12IOExceptionNoSuchAlgorithmExceptionCertificateExceptionKeyStoreExceptionNoSuchProviderExceptionIllegalArgumentException - If the parameter inputStreamOfP12 is null.public X509Certificate loadDERCertificate(String filePath) throws IOException, CertificateException
IOExceptionCertificateExceptionpublic X509Certificate loadDERCertificate(InputStream certificateInputStream) throws IOException, CertificateException
InputStream.
The caller is responsible for closing the stream after this method returns successfully or fails.certificateInputStream - InputStream containing the certificate.IOExceptionCertificateExceptionCopyright © 2012–2015. All rights reserved.