Class Signers
java.lang.Object
org.hyperledger.fabric.client.identity.Signers
Factory methods to create standard signing implementations.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Signer
newPrivateKeySigner
(PrivateKey privateKey) Create a new signer that uses the supplied private key for signing.
-
Method Details
-
newPrivateKeySigner
Create a new signer that uses the supplied private key for signing. TheIdentities
class provides static methods to create aPrivateKey
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.
-