public interface IPRCrypto
Modifier and Type | Interface and Description |
---|---|
static class |
IPRCrypto.CryptoPrefix |
static class |
IPRCrypto.DigestAlgorithm |
static class |
IPRCrypto.Scope |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ENCRYPTED_ACTION_ATTRIBUTE_NAME |
static java.lang.String |
IS_ENCRYPTED_ACTION |
static java.lang.String |
VERSION |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
decrypt(java.lang.String aInput)
Decrypts the specified string.
|
java.lang.String |
decrypt(java.lang.String aInput,
int[] aType)
Alternate decryption entry for use during initialization of PegaRULES.
|
byte[] |
decryptPortable(byte[] aInput)
Decrypts the specified byte array using PegaRULES default portable
and reversible encryption cipher.
|
java.lang.String |
decryptPropertyValue(java.lang.String aInput)
Decrypts the specified property value using a site specific cipher.
|
java.lang.String |
decryptUsingKeyStore(java.lang.String aInput)
Decrypts the specified string using keystore configured at security landing page
|
java.lang.String |
digestString(java.lang.String aString,
int aMethod)
Encrypts a string using PegaRULES v7 algorithm
The entire string, converted to a byte array using UTF-8 encoding,
is passed through the hashing algorithm.
|
java.lang.String |
digestString(java.lang.String aInput,
IPRCrypto.DigestAlgorithm aAlgorithm)
Returns the hashed value of a String input.
|
java.lang.String |
encrypt(java.lang.String aInput)
Encrypts the specified string using keystore or site-specific reversible
encryption cipher if it exists, otherwise the PegaRULES
default portable and reversible encryption cipher.
|
java.lang.String |
encryptOneWay(java.lang.String aInput)
One-way encrypts the specified string.
|
byte[] |
encryptPortable(byte[] aInput)
Encrypts the specified byte array using PegaRULES default portable
and reversible encryption cipher.
|
java.lang.String |
encryptPortable(java.lang.String aInput)
Encrypts the specified string using PegaRULES default portable
and reversible encryption cipher.
|
java.lang.String |
encryptPropertyValue(java.lang.String aInput)
Encrypts the specified property value using a site specific cipher.
|
java.lang.String |
encryptURLActionString(PRThread thread,
java.lang.String scope,
java.lang.String input) |
java.lang.String |
encryptURLActionString(PublicAPI aTools,
java.lang.String scope,
java.lang.String input) |
java.lang.String |
encryptURLActionStringWithGlobalScope(PRThread thread,
java.lang.String input) |
java.lang.String |
encryptUsingKeyStore(java.lang.String aInput)
Encrypts the specified string using keystore configured at security landing page
|
java.lang.String |
encryptUsingKeyStoreDoNotCheckCurrentKeyExpiry(java.lang.String aInput)
Encrypts the specified string using keystore configured at security landing page.
|
java.lang.String |
generateRandomPassword(PublicAPI tools,
int minOperPwdLen,
int minNumerics,
int minLowerCase,
int minUpperCase,
int minSpecials) |
java.lang.String |
getActivatedDataEncryptionType()
Return "AWS" if AWS KMS Cipher is enabled in Encryption landing page
Return "SITE_SPECIFIC" if site-specific cipher is enabled in Encryption landing page.
|
IPRCipher |
getCipher(java.lang.String aAlgorithm,
byte[] aKey,
int aKeylen,
byte[] aParams)
Constructs an IPRCipher implementation with the specified parameters.
|
IPRCipher |
getCipher(java.lang.String aProvider,
java.lang.String aAlgorithm,
byte[] aKey,
int aKeylen,
byte[] aParams)
Constructs an IPRCipher implementation with the specified parameters.
|
IPRCipher |
getPortableCipher()
returns the PegaRULES default portable cipher implementation.
|
IPRCipher |
getSiteCipher()
returns the site-specific cipher implementation.
|
boolean |
isValidKeyStoreKMSType(java.lang.String kmsType) |
boolean |
samePassword(java.lang.String pw1,
java.lang.String pw2)
Returns
true if the two passwords represent the same cleartext
value. |
IPasswordResult |
samePasswordAndUpgradeIfRequired(java.lang.String pw1,
java.lang.String pw2)
Returns
"true" if the two passwords represent the same cleartext
value and if both are hashed using same algorithm. |
static final java.lang.String VERSION
static final java.lang.String ENCRYPTED_ACTION_ATTRIBUTE_NAME
static final java.lang.String IS_ENCRYPTED_ACTION
IPRCipher getPortableCipher()
IPRCipher getSiteCipher()
null
IPRCipher getCipher(java.lang.String aAlgorithm, byte[] aKey, int aKeylen, byte[] aParams)
aAlgorithm
- Algorithm or transform to be used (e.g. desede or des/none/pkcs5padding)aKey
- algorithm specific key or null
to use a generated keyaKeylen
- length of key to be usedaParams
- initialization vector (for padding)IPRCipher getCipher(java.lang.String aProvider, java.lang.String aAlgorithm, byte[] aKey, int aKeylen, byte[] aParams)
aProvider
- specific provider name to use or null
if a JDK default provider should be usedaAlgorithm
- Algorithm or transform to be used (e.g. desede or des/none/pkcs5padding)aKey
- algorithm specific key or null
to use a generated keyaKeylen
- length of key to be usedaParams
- initialization vector (for padding)java.lang.String encryptOneWay(java.lang.String aInput)
aInput
- cleartext string to encryptjava.lang.String encryptPortable(java.lang.String aInput)
aInput
- cleartext string to encryptbyte[] encryptPortable(byte[] aInput)
aInput
- byte array to encryptbyte[] decryptPortable(byte[] aInput)
aInput
- byte array to encryptjava.lang.String encrypt(java.lang.String aInput)
aInput
- cleartext string to encryptboolean isValidKeyStoreKMSType(java.lang.String kmsType)
kmsType
- java.lang.String encryptUsingKeyStore(java.lang.String aInput)
aInput
- cleartext string to encryptjava.lang.String encryptUsingKeyStoreDoNotCheckCurrentKeyExpiry(java.lang.String aInput)
aInput
- cleartext string to encryptjava.lang.String decryptUsingKeyStore(java.lang.String aInput)
aInput
- cleartext string to encryptjava.lang.String encryptPropertyValue(java.lang.String aInput)
aInput
- cleartext string to encryptjava.lang.String decryptPropertyValue(java.lang.String aInput)
aInput
- cleartext string to decryptjava.lang.String decrypt(java.lang.String aInput)
If input is ONEWAY encrypted, the ONEWAY value (after being unwrapped from the V5 envelope, if necessary) is returned.
If input is SITE_SPECIFIC encrypted and no site-specific cipher is available, a CryptographicException is thrown.
If input uses an unrecognized cipher or is otherwise opaque to this routine (including a cleartext value), the input value is returned unchanged.
aInput
- value to decrypt to cleartextjava.lang.String decrypt(java.lang.String aInput, int[] aType)
aInput
- value to decrypt to cleartextaType
- int[2] array for internal useboolean samePassword(java.lang.String pw1, java.lang.String pw2)
true
if the two passwords represent the same cleartext
value. If both passwords are null, the result is true
, otherwise
they must match as defined herein.
If both passwords use the same encryption algorithm (including values
treated as cleartext due to unrecognized format), the result of calling
decrypt
on both strings is compared.
If exactly one of the passwords is oneway encrypted, the other value's
decrypt
result is oneway encrypted and the (unwrapped) oneway
values are compared.
Otherwise, the result of calling decrypt
on both strings is
compared, although the result is almost certainly false
.
pw1
- first comparandpw2
- second comparandIPasswordResult samePasswordAndUpgradeIfRequired(java.lang.String pw1, java.lang.String pw2)
"true"
if the two passwords represent the same cleartext
value and if both are hashed using same algorithm.
Returns "true|newlyHashedPassword"
if the two passowrds represent
the same clear text and if both are hashed using different algorithms.
If both passwords are null, the result is true
, otherwise
they must match as defined herein.
If both passwords use the same encryption algorithm (including values
treated as cleartext due to unrecognized format), the result of calling
decrypt
on both strings is compared.
If exactly one of the passwords is oneway encrypted, the other value's
decrypt
result is oneway encrypted and the (unwrapped) oneway
values are compared.
Otherwise, the result of calling decrypt
on both strings is
compared, although the result is almost certainly false
.
pw1
- first comparandpw2
- second comparandjava.lang.String digestString(java.lang.String aInput, IPRCrypto.DigestAlgorithm aAlgorithm)
aInput
- The value to hashaAlgorithm
- The algorithm to use; null uses MD5java.lang.String digestString(java.lang.String aString, int aMethod)
aString
- cleartext stringjava.lang.String generateRandomPassword(PublicAPI tools, int minOperPwdLen, int minNumerics, int minLowerCase, int minUpperCase, int minSpecials)
tools
- minOperPwdLen
- minNumerics
- minLowerCase
- minUpperCase
- minSpecials
- java.lang.String encryptURLActionString(PublicAPI aTools, java.lang.String scope, java.lang.String input)
aTools
- scope
- Thread,requestor, persistent key to be used for encryptioninput
- java.lang.String encryptURLActionString(PRThread thread, java.lang.String scope, java.lang.String input)
thread
- scope
- Thread,requestor, persistent key to be used for encryptioninput
- java.lang.String encryptURLActionStringWithGlobalScope(PRThread thread, java.lang.String input)
thread
- input
- java.lang.String getActivatedDataEncryptionType()
Copyright © 2022 Pegasystems Inc. All Rights Reserved.