public class CipherBase extends Object implements AutoCloseable
| Modifier and Type | Field and Description |
|---|---|
protected VirgilCipherBase |
cipher |
| Modifier | Constructor and Description |
|---|---|
|
CipherBase()
Create a new instance of
CipherBase |
protected |
CipherBase(VirgilCipherBase cipher)
Create a new instance of
CipherBase |
| Modifier and Type | Method and Description |
|---|---|
void |
addKeyRecipient(Recipient recipient,
PublicKey publicKey)
Add key recipient to Cipher.
|
void |
addKeyRecipient(String recipientId,
PublicKey publicKey)
Add key recipient to Cipher.
|
void |
addPasswordRecipient(Password password)
Add password recipient to Cipher.
|
void |
addPasswordRecipient(String password)
Add password recipient to Cipher.
|
void |
close() |
CustomParams |
customParams() |
static long |
defineContentInfoSize(byte[] data)
Define size of content information.
|
byte[] |
getContentInfo()
Returns the content information.
|
void |
removeAllRecipients()
Remove all recipients from Cipher.
|
void |
removeKeyRecipient(Recipient recipient)
Remove key recipient from Cipher.
|
void |
removePasswordRecipient(Password password)
Remove password recipient from Cipher.
|
void |
setContentInfo(byte[] contentInfo)
Sets the content information.
|
protected VirgilCipherBase cipher
public CipherBase()
CipherBaseprotected CipherBase(VirgilCipherBase cipher)
CipherBasecipher - the VirgilCipherBase which will be wrapped by this
istance of CipherBase.public void addKeyRecipient(Recipient recipient, PublicKey publicKey)
public void addKeyRecipient(String recipientId, PublicKey publicKey)
recipientId - the recipient's identifier.publicKey - the public key of recipient.public void removeKeyRecipient(Recipient recipient)
recipient - the recipientpublic void addPasswordRecipient(Password password)
password - the password for data encryption.public void addPasswordRecipient(String password)
password - the password for data encryption.public void removePasswordRecipient(Password password)
password - the password to be removed.public void removeAllRecipients()
public byte[] getContentInfo()
public void setContentInfo(byte[] contentInfo)
contentInfo - the content information.public static long defineContentInfoSize(byte[] data)
data - the content information.public CustomParams customParams()
CustomParamspublic void close()
throws Exception
close in interface AutoCloseableExceptionCopyright © 2016. All rights reserved.