public class CredentialEncrypter
extends java.lang.Object
| Constructor and Description |
|---|
CredentialEncrypter(byte[] initializationBytes)
Creates a new instance initialized from a byte array.
|
CredentialEncrypter(java.lang.String initializationString)
Convenience constructor to initialize from a string converted to a UTF-8 byte array.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
decryptBytes(java.lang.String encryptedCredentials)
Recovers the plaintext bytes from the encrypted value returned by
encryptBytes(byte[]). |
java.lang.String |
decryptString(java.lang.String encryptedCredentials)
Recovers the plaintext String from the encrypted value returned by
encryptString(String). |
java.lang.String |
encryptBytes(byte[] credentials)
Encrypts a byte array and returns a string representation of the encrypted value.
|
java.lang.String |
encryptString(java.lang.String credentials)
Encrypts a String and returns a string representation of the encrypted value.
|
static boolean |
isPotentiallyEncryptedBytes(byte[] bytes)
Returns true if the provided bytes _could_ be encrypted credentials, even if they can't be decrypted
by a specific instance.
|
static boolean |
isPotentiallyEncryptedString(java.lang.String string)
Returns true if the provided String _could_ be encrypted credentials, even if it can't be decrypted
by a specific instance.
|
public CredentialEncrypter(byte[] initializationBytes)
public CredentialEncrypter(java.lang.String initializationString)
public java.lang.String encryptBytes(byte[] credentials)
decryptBytes(String).public java.lang.String encryptString(java.lang.String credentials)
decryptString(String).public byte[] decryptBytes(java.lang.String encryptedCredentials)
encryptBytes(byte[]).public java.lang.String decryptString(java.lang.String encryptedCredentials)
encryptString(String).public static boolean isPotentiallyEncryptedBytes(byte[] bytes)
public static boolean isPotentiallyEncryptedString(java.lang.String string)
Copyright © 2018. All Rights Reserved.