Class PKSigningInformationUtil

java.lang.Object
de.brendamour.jpasskit.signing.PKSigningInformationUtil

public class PKSigningInformationUtil extends Object
  • Constructor Details

    • PKSigningInformationUtil

      public PKSigningInformationUtil()
  • Method Details

    • loadSigningInformation

      public PKSigningInformation loadSigningInformation(String keyStoreFilePath, String keyStorePassword, 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(String keyPath, String keyPassword, String appleWWDRCAFilePath) throws IOException, 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:
      IOException
      IllegalStateException
      CertificateException
    • loadSigningInformationFromPKCS12AndIntermediateCertificate

      public PKSigningInformation loadSigningInformationFromPKCS12AndIntermediateCertificate(InputStream keyStoreInputStream, String keyStorePassword, InputStream appleWWDRCAFileInputStream) throws IOException, 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:
      IOException
      IllegalStateException
      CertificateException
    • loadPKCS12File

      @Deprecated public KeyStore loadPKCS12File(String pathToP12, String password) throws CertificateException, 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:
      IOException
      CertificateException
      IllegalArgumentException
    • loadPKCS12File

      @Deprecated public KeyStore loadPKCS12File(InputStream inputStreamOfP12, String password) throws CertificateException, 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:
      IOException
      CertificateException
      IllegalArgumentException - If the parameter inputStreamOfP12 is null.
    • loadDERCertificate

      @Deprecated public X509Certificate loadDERCertificate(String filePath) throws IOException, 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:
      IOException
      CertificateException
    • loadDERCertificate

      @Deprecated public X509Certificate loadDERCertificate(InputStream certificateInputStream) throws IOException, 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:
      IOException
      CertificateException