public class Signer extends Object implements AutoCloseable
| Constructor and Description |
|---|
Signer()
Create new instance.
|
Signer(VirgilHash hash)
Create new version.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
byte[] |
sign(byte[] data,
PrivateKey privateKey)
Sign data with private key.
|
byte[] |
sign(byte[] data,
PrivateKey privateKey,
Password privateKeyPassword)
Sign data with private key protected with password.
|
boolean |
verify(byte[] data,
byte[] sign,
PublicKey publicKey)
Verify data with signature.
|
public Signer()
public Signer(VirgilHash hash)
hash - public byte[] sign(byte[] data,
PrivateKey privateKey)
data - the data to be signed.privateKey - the private key.PrivateKeypublic byte[] sign(byte[] data,
PrivateKey privateKey,
Password privateKeyPassword)
data - the data to be signed.privateKey - the private key.privateKeyPassword - the private key password.PrivateKey,
Passwordpublic boolean verify(byte[] data,
byte[] sign,
PublicKey publicKey)
data - the data to be verified.sign - the data signature.publicKey - the public key.true if verification successes.public void close()
throws Exception
close in interface AutoCloseableExceptionCopyright © 2016. All rights reserved.