Package totalcross.crypto.signature
Class PKCS1Signature
- java.lang.Object
-
- totalcross.crypto.signature.Signature
-
- totalcross.crypto.signature.PKCS1Signature
-
public class PKCS1Signature extends Signature
This class implements the PKCS #1 signature algorithm.
-
-
Field Summary
Fields Modifier and Type Field Description protected Digestdigest-
Fields inherited from class totalcross.crypto.signature.Signature
key, operation, OPERATION_SIGN, OPERATION_VERIFY
-
-
Constructor Summary
Constructors Constructor Description PKCS1Signature(Digest digest)Creates a new PKCS1Signature algorithm with the given message digest.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoReset()protected byte[]doSign(byte[] data)protected booleandoVerify(byte[] data, byte[] signature)protected voidfinalize()java.lang.StringgetAlgorithm()Returns the name of the algorithm.protected booleanisKeySupported(Key key, int operation)
-
-
-
Field Detail
-
digest
protected Digest digest
-
-
Constructor Detail
-
PKCS1Signature
public PKCS1Signature(Digest digest) throws NoSuchAlgorithmException, CryptoException
Creates a new PKCS1Signature algorithm with the given message digest.- Parameters:
digest- The message digest.- Throws:
CryptoException- If the given message digest is not supported.NoSuchAlgorithmException- If no Provider supports a Signature implementation for the specified algorithm.
-
-
Method Detail
-
getAlgorithm
public java.lang.String getAlgorithm()
Returns the name of the algorithm.- Specified by:
getAlgorithmin classSignature- Returns:
- The name of the algorithm used.
-
isKeySupported
protected boolean isKeySupported(Key key, int operation)
- Specified by:
isKeySupportedin classSignature
-
doReset
protected void doReset() throws NoSuchAlgorithmException, CryptoException- Specified by:
doResetin classSignature- Throws:
NoSuchAlgorithmExceptionCryptoException
-
doSign
protected byte[] doSign(byte[] data) throws CryptoException- Specified by:
doSignin classSignature- Throws:
CryptoException
-
doVerify
protected boolean doVerify(byte[] data, byte[] signature) throws CryptoException- Specified by:
doVerifyin classSignature- Throws:
CryptoException
-
finalize
protected final void finalize()
- Overrides:
finalizein classjava.lang.Object
-
-