Class PKSigningInformationUtil


  • public class PKSigningInformationUtil
    extends java.lang.Object
    • Constructor Detail

      • PKSigningInformationUtil

        public PKSigningInformationUtil()
    • Method Detail

      • loadSigningInformation

        public PKSigningInformation loadSigningInformation​(java.lang.String keyStoreFilePath,
                                                           java.lang.String keyStorePassword,
                                                           java.lang.String appleWWDRCAFilePath)
                                                    throws PKSigningException
        Load all signing information necessary for pass generation from the filesystem or classpath.
        Parameters:
        keyStoreFilePath - path to keystore (classpath or filesystem)
        keyStorePassword - Password used to access the key store
        appleWWDRCAFilePath - path to apple's WWDRCA certificate file (classpath or filesystem)
        Returns:
        a PKSigningInformation object filled with all certificates from the provided files
        Throws:
        PKSigningException
      • loadSigningInformationFromPKCS12AndIntermediateCertificate

        public PKSigningInformation loadSigningInformationFromPKCS12AndIntermediateCertificate​(java.lang.String keyPath,
                                                                                               java.lang.String keyPassword,
                                                                                               java.lang.String appleWWDRCAFilePath)
                                                                                        throws java.io.IOException,
                                                                                               java.security.cert.CertificateException
        Load all signing information necessary for pass generation from the filesystem or classpath.
        Parameters:
        keyPath - path to keystore (classpath or filesystem)
        keyPassword - Password used to access the key store
        appleWWDRCAFilePath - path to apple's WWDRCA certificate file (classpath or filesystem)
        Returns:
        a PKSigningInformation object filled with all certificates from the provided files
        Throws:
        java.io.IOException
        java.lang.IllegalStateException
        java.security.cert.CertificateException
      • loadSigningInformationFromPKCS12AndIntermediateCertificate

        public PKSigningInformation loadSigningInformationFromPKCS12AndIntermediateCertificate​(java.io.InputStream keyStoreInputStream,
                                                                                               java.lang.String keyStorePassword,
                                                                                               java.io.InputStream appleWWDRCAFileInputStream)
                                                                                        throws java.io.IOException,
                                                                                               java.security.cert.CertificateException
        Load all signing information necessary for pass generation using two input streams for the key store and the Apple WWDRCA certificate. The caller is responsible for closing the stream after this method returns successfully or fails.
        Parameters:
        keyStoreInputStream - InputStream of the key store
        keyStorePassword - Password used to access the key store
        appleWWDRCAFileInputStream - InputStream of the Apple WWDRCA certificate.
        Returns:
        Signing information necessary to sign a pass.
        Throws:
        java.io.IOException
        java.lang.IllegalStateException
        java.security.cert.CertificateException
      • loadPKCS12File

        @Deprecated
        public java.security.KeyStore loadPKCS12File​(java.lang.String pathToP12,
                                                     java.lang.String password)
                                              throws java.security.cert.CertificateException,
                                                     java.io.IOException
        Deprecated.
        Load PKCS12 keystore file from file (will try to load it from the classpath)
        Parameters:
        pathToP12 - path to PKCS 12 file (on the filesystem or classpath)
        password - password to access the key store
        Returns:
        Key store loaded from the provided files
        Throws:
        java.io.IOException
        java.security.cert.CertificateException
        java.lang.IllegalArgumentException
      • loadPKCS12File

        @Deprecated
        public java.security.KeyStore loadPKCS12File​(java.io.InputStream inputStreamOfP12,
                                                     java.lang.String password)
                                              throws java.security.cert.CertificateException,
                                                     java.io.IOException
        Deprecated.
        Load the keystore from an already opened input stream. The caller is responsible for closing the stream after this method returns successfully or fails.
        Parameters:
        inputStreamOfP12 - InputStream containing the signing key store.
        password - Password to access the key store
        Returns:
        Key store loaded from inputStreamOfP12
        Throws:
        java.io.IOException
        java.security.cert.CertificateException
        java.lang.IllegalArgumentException - If the parameter inputStreamOfP12 is null.
      • loadDERCertificate

        @Deprecated
        public java.security.cert.X509Certificate loadDERCertificate​(java.lang.String filePath)
                                                              throws java.io.IOException,
                                                                     java.security.cert.CertificateException
        Deprecated.
        Load certificate file in DER format from the filesystem or the classpath
        Parameters:
        filePath - Path to the file, containing the certificate.
        Returns:
        Loaded certificate.
        Throws:
        java.io.IOException
        java.security.cert.CertificateException
      • loadDERCertificate

        @Deprecated
        public java.security.cert.X509Certificate loadDERCertificate​(java.io.InputStream certificateInputStream)
                                                              throws java.io.IOException,
                                                                     java.security.cert.CertificateException
        Deprecated.
        Load a DER Certificate from an InputStream. The caller is responsible for closing the stream after this method returns successfully or fails.
        Parameters:
        certificateInputStream - InputStream containing the certificate.
        Returns:
        Loaded certificate.
        Throws:
        java.io.IOException
        java.security.cert.CertificateException