public final class CredentialCipher extends Object
Credentials
. It's key is generated dynamically, being unique
for the lifetime of the class.
When using the this class to encrypt or decrypt using provided methods, make sure that the same "instance" is used
for both the operations. Otherwise you might get exception while decrypting.Modifier and Type | Field and Description |
---|---|
static String |
HIPPO_CLUSTER_KEY |
Modifier and Type | Method and Description |
---|---|
javax.jcr.Credentials |
decrypt(String key,
byte[] bytes) |
javax.jcr.Credentials |
decryptFromString(String key,
String credentialString)
Get the Credentials by decrypting UrlSafeBase64 encoded String.
|
byte[] |
encrypt(String key,
javax.jcr.SimpleCredentials credentials) |
String |
getEncryptedString(String key,
javax.jcr.SimpleCredentials credentials)
Get the credentials as UrlSafeBase64 encoded String.
|
static CredentialCipher |
getInstance() |
public static final String HIPPO_CLUSTER_KEY
public static CredentialCipher getInstance()
public byte[] encrypt(String key, javax.jcr.SimpleCredentials credentials)
public String getEncryptedString(String key, javax.jcr.SimpleCredentials credentials)
credentials
- JCR Simple Credentialspublic javax.jcr.Credentials decryptFromString(String key, String credentialString) throws SignatureException
credentialString
- UrlSafeBase64 encoded string which contains encrypted JCR credential String.SignatureException
public javax.jcr.Credentials decrypt(String key, byte[] bytes) throws SignatureException
SignatureException
Copyright © 2012–2015 Hippo B.V. (http://www.onehippo.com). All rights reserved.