| Constructor and Description |
|---|
ICryptoImpl(java.lang.String apiKey,
java.lang.String clientName,
java.lang.String peacemakrHostname,
Persister persister,
org.apache.log4j.Logger logger) |
| 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.
|
protected io.peacemakr.corecrypto.AsymmetricCipher |
getAsymmetricCipher(java.lang.String asymmetricCipher,
int bitlength) |
protected ApiClient |
getClient() |
java.lang.String |
getDebugInfo()
For visibility or debugging purposes, returns a string whihc identifies which
client and configuration this client is running.
|
void |
init() |
protected CryptoConfig |
loadCryptoConfig(ApiClient apiClient) |
void |
register()
Registers to PeaceMakr as a client.
|
void |
sync()
Sync all available keys for this client.
|
public ICryptoImpl(java.lang.String apiKey,
java.lang.String clientName,
java.lang.String peacemakrHostname,
Persister persister,
org.apache.log4j.Logger logger)
public void init()
throws PeacemakrException
PeacemakrExceptionprotected ApiClient getClient() throws PeacemakrException
PeacemakrExceptionprotected CryptoConfig loadCryptoConfig(ApiClient apiClient) throws ServerException
ServerExceptionpublic void register()
throws PeacemakrException
ICryptoregister in interface ICryptoPeacemakrException - 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.protected io.peacemakr.corecrypto.AsymmetricCipher getAsymmetricCipher(java.lang.String asymmetricCipher,
int bitlength)
public void sync()
throws PeacemakrException
ICryptosync in interface ICryptoPeacemakrException - 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.public byte[] encrypt(byte[] plainText)
throws PeacemakrException
ICryptoencrypt in interface ICryptoplainText - Plaintext bytes to encrypt.PeacemakrException - On any error (network connectivity issues, authN issues, etc)public byte[] encryptInDomain(byte[] plainText,
java.lang.String useDomainName)
throws PeacemakrException
ICryptoencryptInDomain in interface ICryptoplainText - Plaintext to encrypt.useDomainName - Non-unique User Domain of your organization's.PeacemakrException - if an exception occurs during the encryption.public byte[] decrypt(byte[] cipherText)
throws PeacemakrException
ICryptodecrypt in interface ICryptocipherText - CipherText to decrypt.PeacemakrException - if an exception occurs during the decryption.public java.lang.String getDebugInfo()
ICryptogetDebugInfo in interface ICrypto