Module jdk.jartool

Class JarSigner.Builder

java.lang.Object
jdk.security.jarsigner.JarSigner.Builder
Enclosing class:
JarSigner

public static class JarSigner.Builder extends Object
A mutable builder class that can create an immutable JarSigner from various signing-related parameters.
Since:
9
  • Constructor Details

    • Builder

      public Builder(KeyStore.PrivateKeyEntry entry)
      Creates a JarSigner.Builder object with a KeyStore.PrivateKeyEntry object.
      Parameters:
      entry - the KeyStore.PrivateKeyEntry of the signer.
    • Builder

      public Builder(PrivateKey privateKey, CertPath certPath)
      Creates a JarSigner.Builder object with a private key and a certification path.
      Parameters:
      privateKey - the private key of the signer.
      certPath - the certification path of the signer.
      Throws:
      IllegalArgumentException - if certPath is empty, or the privateKey algorithm does not match the algorithm of the PublicKey in the end entity certificate (the first certificate in certPath).
  • Method Details