public class VirgilSigner extends Object implements AutoCloseable
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
swigCMemOwn |
| Modifier | Constructor and Description |
|---|---|
|
VirgilSigner()
Create a new instance of
VirgilSigner |
protected |
VirgilSigner(long cPtr,
boolean cMemoryOwn) |
|
VirgilSigner(VirgilHash.Algorithm hashAlgorithm)
Create a new instance of
VirgilSigner |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
delete() |
protected void |
finalize() |
protected static long |
getCPtr(VirgilSigner obj) |
byte[] |
sign(byte[] data,
byte[] privateKey)
Sign data with given private key.
|
byte[] |
sign(byte[] data,
byte[] privateKey,
byte[] privateKeyPassword)
Sign data with given private key.
|
boolean |
verify(byte[] data,
byte[] sign,
byte[] publicKey)
Verify sign and data to be conformed to the given public key.
|
protected VirgilSigner(long cPtr,
boolean cMemoryOwn)
public VirgilSigner(VirgilHash.Algorithm hashAlgorithm)
Create a new instance of VirgilSigner
Specified hash function algorithm is used only during signing.
hashAlgorithm - the hash algorithm.public VirgilSigner()
VirgilSignerprotected static long getCPtr(VirgilSigner obj)
public void delete()
public void close()
close in interface AutoCloseablepublic byte[] sign(byte[] data,
byte[] privateKey,
byte[] privateKeyPassword)
data - the data to be signed.privateKey - the private key protected with password.privateKeyPassword - the private key password.public byte[] sign(byte[] data,
byte[] privateKey)
data - the data to be signed.privateKey - the private key.public boolean verify(byte[] data,
byte[] sign,
byte[] publicKey)
data - the data signed with sign.sign - the signature.publicKey - the public key.true if sign is valid and data was not malformed.Copyright © 2016. All rights reserved.