Top Fields Constructors Methods
org.apache.sshd.common.signature

public abstract Class AbstractSecurityKeySignature

extends Object
implements Signature
Class Inheritance
All Implemented Interfaces
org.apache.sshd.common.signature.Signature, org.apache.sshd.common.AlgorithmNameProvider
Known Direct Subclasses
org.apache.sshd.common.signature.SignatureSkECDSA, org.apache.sshd.common.signature.SignatureSkED25519
Imports
java.nio.charset.StandardCharsets, java.security.GeneralSecurityException, .MessageDigest, .PrivateKey, .PublicKey, org.apache.sshd.common.config.keys.u2f.SecurityKeyPublicKey, org.apache.sshd.common.session.SessionContext, org.apache.sshd.common.util.buffer.ByteArrayBuffer, org.apache.sshd.common.util.security.SecurityUtils

Field Summary

Modifier and TypeField and Description
private MessageDigest
private static final int
private final String
private SecurityKeyPublicKey<?>

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
protected abstract Signature
protected abstract String
public void
initSigner(SessionContext
The SessionContext for calling this method - may be null if not called within a session context
session
,
PrivateKey
The PrivateKey to be used for signing
key
)

Implements org.apache.sshd.common.signature.Signature.initSigner.

public void
initVerifier(SessionContext
The SessionContext for calling this method - may be null if not called within a session context
session
,
PublicKey
The PublicKey to be used for verifying signatures
key
)

Implements org.apache.sshd.common.signature.Signature.initVerifier.

public byte[]
sign(SessionContext
The SessionContext for calling this method - may be null if not called within a session context
session
)

Implements org.apache.sshd.common.signature.Signature.sign.

Compute the signature

public void
update(SessionContext
The SessionContext for calling this method - may be null if not called within a session context
session
,
byte[]
The hash data buffer
hash
,
int
Offset of hash data in buffer
off
,
int
Length of hash data
len
)

Implements org.apache.sshd.common.signature.Signature.update.

Update the computed signature with the given data

public boolean
verify(SessionContext
The SessionContext for calling this method - may be null if not called within a session context
session
,
byte[]
The signed data
sig
)

Implements org.apache.sshd.common.signature.Signature.verify.

Verify against the given signature

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

challengeDigestback to summary
private MessageDigest challengeDigest
FLAG_USER_PRESENCEback to summary
private static final int FLAG_USER_PRESENCE
keyTypeback to summary
private final String keyType
publicKeyback to summary
private SecurityKeyPublicKey<?> publicKey

Constructor Detail

AbstractSecurityKeySignatureback to summary
protected AbstractSecurityKeySignature(String keyType)

Method Detail

getDelegateSignatureback to summary
protected abstract Signature getDelegateSignature()
getSignatureKeyTypeback to summary
protected abstract String getSignatureKeyType()
initSignerback to summary
public void initSigner(SessionContext session, PrivateKey key)

Implements org.apache.sshd.common.signature.Signature.initSigner.

Parameters
session:SessionContext

Doc from org.apache.sshd.common.signature.Signature.initSigner.

The SessionContext for calling this method - may be null if not called within a session context

key:PrivateKey

Doc from org.apache.sshd.common.signature.Signature.initSigner.

The PrivateKey to be used for signing

Annotations
@Override
initVerifierback to summary
public void initVerifier(SessionContext session, PublicKey key) throws GeneralSecurityException

Implements org.apache.sshd.common.signature.Signature.initVerifier.

Parameters
session:SessionContext

Doc from org.apache.sshd.common.signature.Signature.initVerifier.

The SessionContext for calling this method - may be null if not called within a session context

key:PublicKey

Doc from org.apache.sshd.common.signature.Signature.initVerifier.

The PublicKey to be used for verifying signatures

Annotations
@Override
signback to summary
public byte[] sign(SessionContext session)

Implements org.apache.sshd.common.signature.Signature.sign.

Doc from org.apache.sshd.common.signature.Signature.sign.

Compute the signature

Parameters
session:SessionContext

The SessionContext for calling this method - may be null if not called within a session context

Returns:byte[]

The signature value

Annotations
@Override
updateback to summary
public void update(SessionContext session, byte[] hash, int off, int len)

Implements org.apache.sshd.common.signature.Signature.update.

Doc from org.apache.sshd.common.signature.Signature.update.

Update the computed signature with the given data

Parameters
session:SessionContext

The SessionContext for calling this method - may be null if not called within a session context

hash:byte[]

The hash data buffer

off:int

Offset of hash data in buffer

len:int

Length of hash data

Annotations
@Override
verifyback to summary
public boolean verify(SessionContext session, byte[] sig) throws Exception

Implements org.apache.sshd.common.signature.Signature.verify.

Doc from org.apache.sshd.common.signature.Signature.verify.

Verify against the given signature

Parameters
session:SessionContext

The SessionContext for calling this method - may be null if not called within a session context

sig:byte[]

The signed data

Returns:boolean

true if signature is valid

Annotations
@Override
Exceptions
Exception:
If failed to extract signed data for validation