Package dev.sigstore.encryption.signers
Interface Signer
-
- All Known Implementing Classes:
EcdsaSigner,RsaSigner
public interface SignerA signing helper that wraps common signing operations for use within this library.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.security.PublicKeygetPublicKey()Return the public key associated with this signer.byte[]sign(byte[] artifact)Sign an artifact.byte[]signDigest(byte[] artifactDigest)Sign an artifact digest.
-
-
-
Method Detail
-
getPublicKey
java.security.PublicKey getPublicKey()
Return the public key associated with this signer.
-
sign
byte[] sign(byte[] artifact) throws java.security.NoSuchAlgorithmException, java.security.InvalidKeyException, java.security.SignatureExceptionSign an artifact. Implementations will hash the artifact with sha256 before signing.- Parameters:
artifact- the bytes to be signed- Throws:
java.security.NoSuchAlgorithmExceptionjava.security.InvalidKeyExceptionjava.security.SignatureException
-
signDigest
byte[] signDigest(byte[] artifactDigest) throws java.security.NoSuchAlgorithmException, java.security.InvalidKeyException, java.security.SignatureExceptionSign an artifact digest. Implementations will not further hash the inputs.- Parameters:
artifactDigest- the sha256 digest of the artifact to be signed- Throws:
java.security.NoSuchAlgorithmExceptionjava.security.InvalidKeyExceptionjava.security.SignatureException
-
-