public class VirgilStreamSigner extends Object implements AutoCloseable
This class provides high-level interface to sign and verify data using Virgil Security keys.
This module can sign / verify data provided by stream.
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
swigCMemOwn |
| Modifier | Constructor and Description |
|---|---|
|
VirgilStreamSigner()
Create a new instance of
VirgilStreamSigner |
protected |
VirgilStreamSigner(long cPtr,
boolean cMemoryOwn) |
|
VirgilStreamSigner(VirgilHash.Algorithm hashAlgorithm)
Create a new instance of
VirgilStreamSigner |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
delete() |
protected void |
finalize() |
protected static long |
getCPtr(VirgilStreamSigner obj) |
byte[] |
sign(VirgilDataSource source,
byte[] privateKey)
Sign data provided by the source with given private key.
|
byte[] |
sign(VirgilDataSource source,
byte[] privateKey,
byte[] privateKeyPassword)
Sign data provided by the source with given private key.
|
boolean |
verify(VirgilDataSource source,
byte[] sign,
byte[] publicKey)
Verify sign and data provided by the source to be conformed to the given
public key.
|
protected VirgilStreamSigner(long cPtr,
boolean cMemoryOwn)
public VirgilStreamSigner(VirgilHash.Algorithm hashAlgorithm)
VirgilStreamSignerhashAlgorithm - the hash algorithm.public VirgilStreamSigner()
VirgilStreamSignerprotected static long getCPtr(VirgilStreamSigner obj)
public void delete()
public void close()
close in interface AutoCloseablepublic byte[] sign(VirgilDataSource source, byte[] privateKey, byte[] privateKeyPassword)
source - source of the data to be signed.privateKey - the private key protected with password.privateKeyPassword - the private key password.public byte[] sign(VirgilDataSource source, byte[] privateKey)
source - source of the data to be signed.privateKey - the private key.public boolean verify(VirgilDataSource source, byte[] sign, byte[] publicKey)
source - source of the data to be verified.sign - the signature.publicKey - the public key.true if sign is valid and data was not malformed.Copyright © 2016. All rights reserved.