Package net.schmizz.sshj.signature
Class SignatureRSA
- java.lang.Object
-
- net.schmizz.sshj.signature.AbstractSignature
-
- net.schmizz.sshj.signature.SignatureRSA
-
- All Implemented Interfaces:
Signature
public class SignatureRSA extends AbstractSignature
RSASignature
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SignatureRSA.FactoryCERT
A named factory for RSASignature
static class
SignatureRSA.FactoryRSASHA256
A named factory for RSASignature
static class
SignatureRSA.FactoryRSASHA512
A named factory for RSASignature
static class
SignatureRSA.FactorySSHRSA
A named factory for RSASignature
-
Field Summary
Fields Modifier and Type Field Description private KeyType
keyType
-
Fields inherited from class net.schmizz.sshj.signature.AbstractSignature
signature
-
-
Constructor Summary
Constructors Constructor Description SignatureRSA(java.lang.String algorithm, KeyType keyType, java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
encode(byte[] signature)
Encode the signature as blogvoid
initVerify(java.security.PublicKey publicKey)
Initialize this signature with the given public key for signature verification.boolean
verify(byte[] sig)
Verify against the given signature.-
Methods inherited from class net.schmizz.sshj.signature.AbstractSignature
extractSig, getSignatureName, initSign, sign, update, update
-
-
-
-
Field Detail
-
keyType
private KeyType keyType
-
-
Constructor Detail
-
SignatureRSA
public SignatureRSA(java.lang.String algorithm, KeyType keyType, java.lang.String name)
-
-
Method Detail
-
initVerify
public void initVerify(java.security.PublicKey publicKey)
Description copied from interface:Signature
Initialize this signature with the given public key for signature verification. Note that subsequent calls to eitherSignature.initVerify(PublicKey)
orSignature.initSign(PrivateKey)
will overwrite prior initialization.- Specified by:
initVerify
in interfaceSignature
- Overrides:
initVerify
in classAbstractSignature
- Parameters:
publicKey
- the public key to use for signature verification
-
encode
public byte[] encode(byte[] signature)
Description copied from interface:Signature
Encode the signature as blog- Parameters:
signature
- the signature to encode- Returns:
- Encoded signature
-
verify
public boolean verify(byte[] sig)
Description copied from interface:Signature
Verify against the given signature.- Parameters:
sig
- the signature to verify against- Returns:
true
on successful verification,false
on failure
-
-