java.lang.Object
org.hyperledger.fabric.client.identity.Signers

public final class Signers extends Object
Factory methods to create standard signing implementations.
  • Method Details

    • newPrivateKeySigner

      public static Signer newPrivateKeySigner(PrivateKey privateKey)
      Create a new signer that uses the supplied private key for signing. The Identities class provides static methods to create a PrivateKey object from PEM-format data.

      Currently supported private key types are:

      • ECDSA.
      • Ed25519.

      Note that the Sign implementations have different expectations on the input data supplied to them.

      The ECDSA signers operate on a pre-computed message digest, and should be combined with an appropriate hash algorithm. P-256 is typically used with a SHA-256 hash, and P-384 is typically used with a SHA-384 hash.

      The Ed25519 signer operates on the full message content, and should be combined with a NONE (or no-op) hash implementation to ensure the complete message is passed to the signer.

      Parameters:
      privateKey - A private key.
      Returns:
      A signer implementation.