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, wait
getSshAlgorithmName, update
getAlgorithm
protected AbstractSecurityKeySignature(String keyType)
public void initVerifier(SessionContext session, PublicKey key) throws GeneralSecurityException
initVerifier
in interface Signature
session
- The SessionContext
for calling this method - may be null
if not called within a
session contextkey
- The PublicKey
to be used for verifying signaturesGeneralSecurityException
public void update(SessionContext session, byte[] hash, int off, int len)
Signature
update
in interface Signature
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 dataprotected abstract String getSignatureKeyType()
protected abstract Signature getDelegateSignature()
public boolean verify(SessionContext session, byte[] sig) throws Exception
Signature
verify
in interface Signature
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 validationpublic void initSigner(SessionContext session, PrivateKey key)
initSigner
in interface Signature
session
- 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)
Signature
sign
in interface Signature
session
- The SessionContext
for calling this method - may be null
if not called within a
session contextCopyright © 2008–2024 The Apache Software Foundation. All rights reserved.