| Constructor and Description |
|---|
VirgilCrypto() |
| Modifier and Type | Method and Description |
|---|---|
Fingerprint |
calculateFingerprint(byte[] content)
Calculate fingerprint.
|
byte[] |
computeHash(byte[] data,
HashAlgorithm algorithm)
Compute data hash with algorithm specified.
|
static VirgilHash |
createVirgilHash(HashAlgorithm algorithm) |
byte[] |
decrypt(byte[] cipherData,
PrivateKey privateKey)
Decrypt byte array with private key.
|
void |
decrypt(InputStream inputStream,
OutputStream outputStream,
PrivateKey privateKey)
Decrypt stream data with private key.
|
byte[] |
decryptThenVerify(byte[] cipherData,
PrivateKey privateKey,
PublicKey publicKey)
Decrypt data and verify.
|
byte[] |
encrypt(byte[] data,
PublicKey recipient)
Encrypt byte array for single recipient.
|
byte[] |
encrypt(byte[] data,
PublicKey[] recipients)
Encrypt byte array with public key set.
|
void |
encrypt(InputStream inputStream,
OutputStream outputStream,
PublicKey recipient)
Encrypt stream data with public key.
|
void |
encrypt(InputStream inputStream,
OutputStream outputStream,
PublicKey[] recipients)
Encrypt stream data with public key set.
|
byte[] |
exportPrivateKey(PrivateKey privateKey)
Export private key as byte array.
|
byte[] |
exportPrivateKey(PrivateKey privateKey,
String password)
Export private key as byte array.
|
byte[] |
exportPublicKey(PublicKey publicKey)
Export public key as byte array.
|
PublicKey |
extractPublicKey(PrivateKey privateKey)
Extract public key from private key.
|
KeyPair |
generateKeys()
Generate key pair.
|
KeyPair |
generateKeys(KeysType keysType)
Generate key pair by type.
|
PrivateKey |
importPrivateKey(byte[] privateKey)
Import private key from byte array.
|
PrivateKey |
importPrivateKey(byte[] keyData,
String password)
Import private key from byte array.
|
PublicKey |
importPublicKey(byte[] publicKey)
Import public key from byte array.
|
byte[] |
sign(byte[] data,
PrivateKey privateKey)
Sign byte array data with private key.
|
byte[] |
sign(InputStream inputStream,
PrivateKey privateKey)
Sign stream data with private key.
|
byte[] |
signThenEncrypt(byte[] data,
PrivateKey privateKey,
PublicKey recipient)
Sign data and encrypt.
|
byte[] |
signThenEncrypt(byte[] data,
PrivateKey privateKey,
PublicKey[] recipients)
Sign data and encrypt.
|
static VirgilKeyPair.Type |
toVirgilKeyPairType(KeysType keysType) |
boolean |
verify(byte[] data,
byte[] signature,
PublicKey signer)
Verify byte array with signature.
|
boolean |
verify(InputStream inputStream,
byte[] signature,
PublicKey signer)
Verify stream data with signature.
|
public static VirgilHash createVirgilHash(HashAlgorithm algorithm)
public static VirgilKeyPair.Type toVirgilKeyPairType(KeysType keysType)
public Fingerprint calculateFingerprint(byte[] content)
CryptocalculateFingerprint in interface Cryptocontent - The data to calculate fingerprint for.String.public byte[] computeHash(byte[] data,
HashAlgorithm algorithm)
CryptocomputeHash in interface Cryptodata - the data for hashing.algorithm - the algorithm to be used for hash calculation.public byte[] decrypt(byte[] cipherData,
PrivateKey privateKey)
Cryptopublic void decrypt(InputStream inputStream, OutputStream outputStream, PrivateKey privateKey) throws DecryptionException
Cryptodecrypt in interface CryptoinputStream - the input stream to be decrypted.outputStream - the decrypted data as stream.privateKey - the recipients private key.DecryptionExceptionPublicKey,
PrivateKeypublic byte[] decryptThenVerify(byte[] cipherData,
PrivateKey privateKey,
PublicKey publicKey)
CryptodecryptThenVerify in interface CryptocipherData - the encrypted data to be decrypted.privateKey - the private key used for decryption.publicKey - the public key used for verify.public byte[] encrypt(byte[] data,
PublicKey recipient)
Cryptopublic byte[] encrypt(byte[] data,
PublicKey[] recipients)
Cryptopublic void encrypt(InputStream inputStream, OutputStream outputStream, PublicKey recipient) throws EncryptionException
Cryptoencrypt in interface CryptoinputStream - the input stream to be encrypted.outputStream - the output stream encrypted data written to.recipient - the recipient's public key.EncryptionException - if encryption failed.public void encrypt(InputStream inputStream, OutputStream outputStream, PublicKey[] recipients) throws EncryptionException
Cryptoencrypt in interface CryptoinputStream - the input stream to be encrypted.outputStream - the output stream encrypted data written to.recipients - the recipients public key set.EncryptionException - if encryption failed.public byte[] exportPrivateKey(PrivateKey privateKey)
CryptoexportPrivateKey in interface CryptoprivateKey - the private key.PrivateKeypublic byte[] exportPrivateKey(PrivateKey privateKey, String password)
CryptoexportPrivateKey in interface CryptoprivateKey - the private key.password - the private key password.PrivateKeypublic byte[] exportPublicKey(PublicKey publicKey)
CryptoexportPublicKey in interface CryptopublicKey - the public key.PublicKeypublic PublicKey extractPublicKey(PrivateKey privateKey)
CryptoextractPublicKey in interface CryptoprivateKey - the private key.public KeyPair generateKeys()
CryptogenerateKeys in interface CryptoPrivateKey,
PublicKeypublic KeyPair generateKeys(KeysType keysType)
keysType - the key type.public PrivateKey importPrivateKey(byte[] privateKey) throws CryptoException
CryptoimportPrivateKey in interface CryptoprivateKey - the Base64 encoded private key.CryptoException - if private key couldn't be imported.PrivateKeypublic PrivateKey importPrivateKey(byte[] keyData, String password) throws CryptoException
CryptoimportPrivateKey in interface CryptokeyData - the Base64 encoded private key.password - the private key password.CryptoException - if private key couldn't be imported.PrivateKeypublic PublicKey importPublicKey(byte[] publicKey)
CryptoimportPublicKey in interface CryptopublicKey - the public key.PublicKeypublic byte[] sign(byte[] data,
PrivateKey privateKey)
Cryptosign in interface Cryptodata - the data to be signed.privateKey - the signer's private key.PrivateKeypublic byte[] sign(InputStream inputStream, PrivateKey privateKey)
Cryptosign in interface CryptoinputStream - the input stream to be signed.privateKey - the signer's private key.PrivateKeypublic byte[] signThenEncrypt(byte[] data,
PrivateKey privateKey,
PublicKey recipient)
CryptosignThenEncrypt in interface Cryptodata - the data to be signed and encrypted.privateKey - the private key used for signing.recipient - the recipient's public key.public byte[] signThenEncrypt(byte[] data,
PrivateKey privateKey,
PublicKey[] recipients)
CryptosignThenEncrypt in interface Cryptodata - the data to be signed and encrypted.privateKey - the private key used for signing.recipients - the recipient public keys.public boolean verify(byte[] data,
byte[] signature,
PublicKey signer)
Cryptopublic boolean verify(InputStream inputStream, byte[] signature, PublicKey signer)
CryptoCopyright © 2016. All rights reserved.