Package com.trilead.ssh2.signature
Class KeyAlgorithm<U extends java.security.PublicKey,R extends java.security.PrivateKey>
- java.lang.Object
-
- com.trilead.ssh2.signature.KeyAlgorithm<U,R>
-
- Direct Known Subclasses:
DSAKeyAlgorithm
,ECDSAKeyAlgorithm
,ED25519KeyAlgorithm
,RSAKeyAlgorithm
public abstract class KeyAlgorithm<U extends java.security.PublicKey,R extends java.security.PrivateKey> extends java.lang.Object
- Author:
- Michael Clarke
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
KeyAlgorithm(java.lang.String signatureAlgorithm, java.lang.String keyFormat, java.lang.Class<R> keyType)
protected
KeyAlgorithm(java.lang.String signatureAlgorithm, java.lang.String keyFormat, java.lang.Class<R> keyType, java.security.Provider provider)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.security.PublicKey
decodePublicKey(byte[] encodedPublicKey)
abstract byte[]
decodeSignature(byte[] encodedSignature)
abstract byte[]
encodePublicKey(U publicKey)
abstract byte[]
encodeSignature(byte[] signature)
byte[]
generateSignature(byte[] message, R pk, java.security.SecureRandom rnd)
abstract java.util.List<CertificateDecoder>
getCertificateDecoders()
java.lang.String
getKeyFormat()
boolean
supportsKey(java.security.PrivateKey key)
boolean
verifySignature(byte[] message, byte[] ds, U dpk)
-
-
-
Constructor Detail
-
KeyAlgorithm
protected KeyAlgorithm(java.lang.String signatureAlgorithm, java.lang.String keyFormat, java.lang.Class<R> keyType)
-
KeyAlgorithm
protected KeyAlgorithm(java.lang.String signatureAlgorithm, java.lang.String keyFormat, java.lang.Class<R> keyType, java.security.Provider provider)
-
-
Method Detail
-
generateSignature
public byte[] generateSignature(byte[] message, R pk, java.security.SecureRandom rnd) throws java.io.IOException
- Throws:
java.io.IOException
-
verifySignature
public boolean verifySignature(byte[] message, byte[] ds, U dpk) throws java.io.IOException
- Throws:
java.io.IOException
-
getKeyFormat
public java.lang.String getKeyFormat()
-
encodeSignature
public abstract byte[] encodeSignature(byte[] signature) throws java.io.IOException
- Throws:
java.io.IOException
-
decodeSignature
public abstract byte[] decodeSignature(byte[] encodedSignature) throws java.io.IOException
- Throws:
java.io.IOException
-
encodePublicKey
public abstract byte[] encodePublicKey(U publicKey) throws java.io.IOException
- Throws:
java.io.IOException
-
decodePublicKey
public abstract java.security.PublicKey decodePublicKey(byte[] encodedPublicKey) throws java.io.IOException
- Throws:
java.io.IOException
-
getCertificateDecoders
public abstract java.util.List<CertificateDecoder> getCertificateDecoders()
-
supportsKey
public boolean supportsKey(java.security.PrivateKey key)
-
-