public abstract class AbstractSecurityKeySignature extends Object implements Signature
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractSecurityKeySignature(String keyType) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract Signature |
getDelegateSignature() |
protected abstract String |
getSignatureKeyType() |
void |
initSigner(SessionContext session,
PrivateKey key) |
void |
initVerifier(SessionContext session,
PublicKey key) |
byte[] |
sign(SessionContext session)
Compute the signature
|
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
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetSshAlgorithmName, updategetAlgorithmprotected AbstractSecurityKeySignature(String keyType)
public void initVerifier(SessionContext session, PublicKey key) throws GeneralSecurityException
initVerifier in interface Signaturesession - The SessionContext for calling this method - may be null if not called within a
session contextkey - The PublicKey to be used for verifying signaturesGeneralSecurityExceptionpublic void update(SessionContext session, byte[] hash, int off, int len)
Signatureupdate in interface Signaturesession - 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 dataprotected abstract String getSignatureKeyType()
protected abstract Signature getDelegateSignature()
public boolean verify(SessionContext session, byte[] sig) throws Exception
Signatureverify in interface Signaturesession - 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 validationpublic void initSigner(SessionContext session, PrivateKey key)
initSigner in interface Signaturesession - The SessionContext for calling this method - may be null if not called within a
session contextkey - The PrivateKey to be used for signingpublic byte[] sign(SessionContext session)
Signaturesign in interface Signaturesession - The SessionContext for calling this method - may be null if not called within a
session contextCopyright © 2018–2021 The Apache Software Foundation. All rights reserved.