public interface ICrypto
| Modifier and Type | Method and Description |
|---|---|
byte[] |
decrypt(byte[] cipherText)
Decrypt the opaquely packaged ciphertext and return the original plain text.
|
byte[] |
encrypt(byte[] plainText)
Encrypt the plaintext, using a random available usedomain.
|
byte[] |
encryptInDomain(byte[] plainText,
java.lang.String useDomainName)
Encrypt the plaintext, but restrict which keys may be used to a Use Domain of this specific name.
|
java.lang.String |
getDebugInfo()
For visibility or debugging purposes, returns a string whihc identifies which
client and configuration this client is running.
|
void |
register()
Registers to PeaceMakr as a client.
|
void |
sync()
Sync all available keys for this client.
|
void register()
throws PeacemakrException
PeacemakrException - if an exception occurs during the registration. Registration may fail with invalid
apiKey, missing network connectivity, or an invalid persister. On failure, take corrections action and invoke again.void sync()
throws PeacemakrException
PeacemakrException - if an exception occurs during the sync. Sync may fail, if registration was not invoked,
if there's network connectivity issues, or unexpected authorization issues.byte[] encrypt(byte[] plainText)
throws PeacemakrException
plainText - Plaintext bytes to encrypt.PeacemakrException - On any error (network connectivity issues, authN issues, etc)byte[] encryptInDomain(byte[] plainText,
java.lang.String useDomainName)
throws PeacemakrException,
java.io.UnsupportedEncodingException
plainText - Plaintext to encrypt.useDomainName - Non-unique User Domain of your organization's.PeacemakrException - if an exception occurs during the encryption.java.io.UnsupportedEncodingException - if unsupported encoding has been used.byte[] decrypt(byte[] cipherText)
throws PeacemakrException
cipherText - CipherText to decrypt.PeacemakrException - if an exception occurs during the decryption.java.lang.String getDebugInfo()