public interface Signature extends AlgorithmNameProvider
javax.crypto.Signature object.
The reported algorithm name refers to the signature type being applied.| Modifier and Type | Method and Description |
|---|---|
default String |
getSshAlgorithmName(String algo) |
void |
initSigner(SessionContext session,
PrivateKey key) |
void |
initVerifier(SessionContext session,
PublicKey key) |
byte[] |
sign(SessionContext session)
Compute the signature
|
default void |
update(SessionContext session,
byte[] hash)
Update the computed signature with the given data
|
void |
update(SessionContext session,
byte[] hash,
int off,
int len)
Update the computed signature with the given data
|
boolean |
verify(SessionContext session,
byte[] sig)
Verify against the given signature
|
getAlgorithmvoid initVerifier(SessionContext session, PublicKey key) throws Exception
session - The SessionContext for calling this method - may be null if not called within a
session contextkey - The PublicKey to be used for verifying signaturesException - If failed to initializevoid initSigner(SessionContext session, PrivateKey key) throws Exception
session - The SessionContext for calling this method - may be null if not called within a
session contextkey - The PrivateKey to be used for signingException - If failed to initializedefault void update(SessionContext session, byte[] hash) throws Exception
session - The SessionContext for calling this method - may be null if not called within a
session contexthash - The hash data bufferException - If failed to updateupdate(SessionContext, byte[], int, int)void update(SessionContext session, byte[] hash, int off, int len) throws Exception
session - The SessionContext for calling this method - may be null if not called within a
session contexthash - The hash data bufferoff - Offset of hash data in bufferlen - Length of hash dataException - If failed to updateboolean verify(SessionContext session, byte[] sig) throws Exception
session - The SessionContext for calling this method - may be null if not called within a
session contextsig - The signed datatrue if signature is validException - If failed to extract signed data for validationbyte[] sign(SessionContext session) throws Exception
session - The SessionContext for calling this method - may be null if not called within a
session contextException - If failed to calculate the signatureCopyright © 2018–2024 The Apache Software Foundation. All rights reserved.