Package dev.sigstore.encryption.signers
Class RsaVerifier
- java.lang.Object
-
- dev.sigstore.encryption.signers.RsaVerifier
-
- All Implemented Interfaces:
Verifier
public class RsaVerifier extends java.lang.Object implements Verifier
RSA verifier, instantiated byVerifiers.newVerifier(PublicKey).
-
-
Method Summary
All Methods Instance Methods Concrete 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[] digest, byte[] signature)Verify an artifact using the artifact's sha256 digest.
-
-
-
Method Detail
-
getPublicKey
public java.security.PublicKey getPublicKey()
Description copied from interface:VerifierReturn the public key associated with this verifier.- Specified by:
getPublicKeyin interfaceVerifier
-
verify
public boolean verify(byte[] artifact, byte[] signature) throws java.security.NoSuchAlgorithmException, java.security.InvalidKeyException, java.security.SignatureExceptionDescription copied from interface:VerifierVerify an artifact. Implementations will hash the artifact with sha256 before verifying.- Specified by:
verifyin interfaceVerifier- 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
public boolean verifyDigest(byte[] digest, byte[] signature) throws java.security.NoSuchAlgorithmException, java.security.InvalidKeyException, java.security.SignatureExceptionDescription copied from interface:VerifierVerify an artifact using the artifact's sha256 digest. Implementations do not further hash the input.- Specified by:
verifyDigestin interfaceVerifier- Parameters:
digest- 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
-
-