Package dev.sigstore.encryption.signers
Interface Verifier
-
- All Known Implementing Classes:
EcdsaVerifier,RsaVerifier
public interface VerifierA verifier helper that wraps common verification 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 verifier.booleanverify(byte[] artifact, byte[] signature)Verify an artifact.booleanverifyDigest(byte[] artifactDigest, byte[] signature)Verify an artifact using the artifact's sha256 digest.
-
-
-
Method Detail
-
getPublicKey
java.security.PublicKey getPublicKey()
Return the public key associated with this verifier.
-
verify
@CheckReturnValue boolean verify(byte[] artifact, byte[] signature) throws java.security.NoSuchAlgorithmException, java.security.InvalidKeyException, java.security.SignatureExceptionVerify an artifact. Implementations will hash the artifact with sha256 before verifying.- Parameters:
artifact- the artifact that was signedsignature- the signature associated with the artifact- Returns:
- true if the signature is valid, false otherwise
- Throws:
java.security.NoSuchAlgorithmExceptionjava.security.InvalidKeyExceptionjava.security.SignatureException
-
verifyDigest
@CheckReturnValue boolean verifyDigest(byte[] artifactDigest, byte[] signature) throws java.security.NoSuchAlgorithmException, java.security.InvalidKeyException, java.security.SignatureExceptionVerify an artifact using the artifact's sha256 digest. Implementations do not further hash the input.- Parameters:
artifactDigest- the sha256 digest of the artifact that was signedsignature- the signature associated with the artifact- Returns:
- true if the signature is valid, false otherwise
- Throws:
java.security.NoSuchAlgorithmExceptionjava.security.InvalidKeyExceptionjava.security.SignatureException
-
-