|
Oracle Fusion Middleware extensions for Applications Core API Reference 11g Release 1 (11.1.1.5) E22562-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.apps.fnd.applcore.attachments.ucm.util.SigningUtils
public class SigningUtils
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_ALGORITHM
|
static java.lang.String |
KEYSTORE_CRYPT_CSF_KEY_PROPERTY
|
static java.lang.String |
KEYSTORE_CSF_MAP_NAME_PROPERTY
|
static java.lang.String |
KEYSTORE_LOCATION_PROPERTY
|
static java.lang.String |
KEYSTORE_PASS_CSF_KEY_PROPERTY
|
static java.lang.String |
KEYSTORE_SIGN_CSF_KEY_PROPERTY
|
static java.lang.String |
KEYSTORE_TYPE_PROPERTY
|
Constructor Summary | |
---|---|
SigningUtils()
|
Method Summary | |
---|---|
static byte[] |
base64Decode(byte[] b64EncodedBytes)
Decode base64 encoded data into binary |
static byte[] |
base64Encode(byte[] bytes)
Encode binary data into base64 |
static java.lang.String |
byteToHex(byte b)
Returns a string represenation of the byte value in hexadecimal (base 16) |
static java.lang.String |
convertBase64BytesToUrlSafeB64String(byte[] b64EncodedBytes)
base64 bytes are first used to generate a String. |
static byte[] |
convertUrlSafeB64StringToBase64Bytes(java.lang.String urlSafeB64String)
Retrieves the underlying base 64 encoded bytes associated with a String return value obtained from the convertBase64BytesToUrlSafeB64String method. |
static java.util.List<java.security.cert.X509Certificate> |
getFilteredX509Certificates(java.security.KeyStore keystore,
java.util.List<java.lang.String> excludedAliases,
java.util.List<java.lang.String> includedAliases)
Obtains a filtered list of public certificates found in the specified keystore taking in to consideration the optional included/excluded keystore alias lists. |
static java.util.Map<java.lang.String,java.security.cert.X509Certificate> |
getFilteredX509CertificatesMap(java.security.KeyStore keystore,
java.util.List<java.lang.String> excludedAliases,
java.util.List<java.lang.String> includedAliases)
Returns a filtered map of public certificates found in the specified keystore taking in to consideration the optional included/excluded keystore alias lists. |
static java.lang.String |
getFingerPrint(java.security.cert.X509Certificate publicCert,
java.lang.String algorithm)
Returns a fingerprint by applying a cryptographic hash function to the specified public certificate. |
static java.lang.String |
getMD5FingerPrint(java.security.cert.X509Certificate publicCert)
Returns an MD5 fingerprint of the specified public certificate. |
static java.security.PrivateKey |
getPrivateKey(java.security.KeyStore keystore,
java.lang.String keyAlias,
char[] password)
Obtain private key from the specified keystore stored under the entry alias using entry access password provided. |
static java.lang.String |
getSHA1FingerPrint(java.security.cert.X509Certificate publicCert)
Returns an SHA1 fingerprint of the specified public certificate. |
static oracle.security.jps.service.credstore.PasswordCredential |
getWSMEncryptionKeyPC(java.util.Map<java.lang.String,java.lang.String> keyConfig)
Retrieve the WSM encryption-key password credential object referenced by the specified service properties; The password credential contains details of the keystore alias leveraged to store the key, and its associated access password. |
static java.security.PrivateKey |
getWSMEncryptionKeyPrivateKey()
Retrieve the WSM encryption-key private key from the keystore leveraging JPS to obtain keystore and credential store details. |
static java.security.cert.X509Certificate |
getWSMEncryptionKeyX509Certificate()
Retrieve the WSM encryption-key public certificate from the keystore leveraging JPS to obtain keystore and credential store details. |
static java.security.KeyStore |
getWSMKeyStore(java.util.Map<java.lang.String,java.lang.String> keyConfig)
Retrieve the keystore instance referenced by the specified service properties. |
static java.security.cert.X509Certificate |
getX509Certificate(java.security.KeyStore keystore,
java.lang.String keyAlias)
Obtain public certificate from the specified keystore under the entry alias provided. |
static java.util.List<java.security.cert.X509Certificate> |
getX509Certificates(java.security.KeyStore keystore)
Obtains a list of public certificates found in the specified keystore. |
static java.util.Map<java.lang.String,java.security.cert.X509Certificate> |
getX509CertificatesMap(java.security.KeyStore keystore)
Returns a map of public certificates found in the specified keystore keyed by the SHA1 fingerprint string of the certificate concerned. |
static java.security.KeyStore |
loadKeyStore(java.lang.String type,
java.lang.String location,
char[] password)
Load file-based keystore of specified type at provided location using supplied keystore access password. |
static byte[] |
sign(byte[] inputBytes,
java.security.PrivateKey key)
Sign the specified input bytes using the supplied private key and the default algorithm SHA512withRSA (hashing is done with SHA-512, and encryption of the hash is done using RSA). |
static byte[] |
sign(byte[] inputBytes,
java.security.PrivateKey key,
java.lang.String algorithm)
Sign the specified input bytes using the supplied private key and algorithm. |
static boolean |
verify(byte[] inputBytes,
byte[] signature,
java.security.cert.X509Certificate publicCert)
Verify the specified digtal signature is valid based on the supplied input bytes, public certificate and default signing algorithm. |
static boolean |
verify(byte[] inputBytes,
byte[] signature,
java.security.cert.X509Certificate publicCert,
java.lang.String algorithm)
Verify the specified digtal signature is valid based on the supplied input bytes, public certificate and signing algorithm. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_ALGORITHM
public static final java.lang.String KEYSTORE_LOCATION_PROPERTY
public static final java.lang.String KEYSTORE_TYPE_PROPERTY
public static final java.lang.String KEYSTORE_CSF_MAP_NAME_PROPERTY
public static final java.lang.String KEYSTORE_PASS_CSF_KEY_PROPERTY
public static final java.lang.String KEYSTORE_SIGN_CSF_KEY_PROPERTY
public static final java.lang.String KEYSTORE_CRYPT_CSF_KEY_PROPERTY
Constructor Detail |
---|
public SigningUtils()
Method Detail |
---|
public static java.security.KeyStore getWSMKeyStore(java.util.Map<java.lang.String,java.lang.String> keyConfig) throws oracle.security.jps.JpsException, java.security.KeyStoreException, java.io.FileNotFoundException, java.io.IOException, java.security.NoSuchAlgorithmException, java.security.cert.CertificateException, java.security.PrivilegedActionException
keyConfig
- keystore service properties
oracle.security.jps.JpsException
java.security.KeyStoreException
java.io.FileNotFoundException
java.io.IOException
java.security.NoSuchAlgorithmException
java.security.cert.CertificateException
java.security.PrivilegedActionException
public static oracle.security.jps.service.credstore.PasswordCredential getWSMEncryptionKeyPC(java.util.Map<java.lang.String,java.lang.String> keyConfig) throws oracle.security.jps.JpsException, java.security.PrivilegedActionException
keyConfig
- keystore service properties
oracle.security.jps.JpsException
java.security.PrivilegedActionException
public static java.security.PrivateKey getWSMEncryptionKeyPrivateKey() throws oracle.security.jps.JpsException, java.security.KeyStoreException, java.io.FileNotFoundException, java.io.IOException, java.security.NoSuchAlgorithmException, java.security.cert.CertificateException, java.security.UnrecoverableKeyException, java.security.PrivilegedActionException
oracle.security.jps.JpsException
java.security.KeyStoreException
java.io.FileNotFoundException
java.io.IOException
java.security.NoSuchAlgorithmException
java.security.cert.CertificateException
java.security.UnrecoverableKeyException
java.security.PrivilegedActionException
public static java.security.cert.X509Certificate getWSMEncryptionKeyX509Certificate() throws oracle.security.jps.JpsException, java.security.KeyStoreException, java.io.FileNotFoundException, java.io.IOException, java.security.NoSuchAlgorithmException, java.security.cert.CertificateException, java.security.PrivilegedActionException
oracle.security.jps.JpsException
java.security.KeyStoreException
java.io.FileNotFoundException
java.io.IOException
java.security.NoSuchAlgorithmException
java.security.cert.CertificateException
java.security.PrivilegedActionException
public static byte[] sign(byte[] inputBytes, java.security.PrivateKey key) throws java.security.NoSuchAlgorithmException, java.security.InvalidKeyException, java.security.SignatureException
inputBytes
- input byteskey
- private key used for signing
java.security.NoSuchAlgorithmException
java.security.InvalidKeyException
java.security.SignatureException
public static byte[] sign(byte[] inputBytes, java.security.PrivateKey key, java.lang.String algorithm) throws java.security.NoSuchAlgorithmException, java.security.InvalidKeyException, java.security.SignatureException
inputBytes
- input byteskey
- private key used for signingalgorithm
- signature algorithm
java.security.NoSuchAlgorithmException
java.security.InvalidKeyException
java.security.SignatureException
public static boolean verify(byte[] inputBytes, byte[] signature, java.security.cert.X509Certificate publicCert) throws java.security.NoSuchAlgorithmException, java.security.InvalidKeyException, java.security.SignatureException
inputBytes
- input bytessignature
- digital signature created using private keypublicCert
- public certificate
java.security.NoSuchAlgorithmException
java.security.InvalidKeyException
java.security.SignatureException
public static boolean verify(byte[] inputBytes, byte[] signature, java.security.cert.X509Certificate publicCert, java.lang.String algorithm) throws java.security.NoSuchAlgorithmException, java.security.InvalidKeyException, java.security.SignatureException
inputBytes
- input bytessignature
- digital signature created using private keypublicCert
- public certificatealgorithm
- signature algorithm
java.security.NoSuchAlgorithmException
java.security.InvalidKeyException
java.security.SignatureException
public static java.security.KeyStore loadKeyStore(java.lang.String type, java.lang.String location, char[] password) throws java.security.KeyStoreException, java.io.FileNotFoundException, java.io.IOException, java.security.NoSuchAlgorithmException, java.security.cert.CertificateException
type
- keystore type - e.g. JKSlocation
- file location of keystorepassword
- keystore access password
java.security.KeyStoreException
java.io.FileNotFoundException
java.io.IOException
java.security.NoSuchAlgorithmException
java.security.cert.CertificateException
public static java.security.PrivateKey getPrivateKey(java.security.KeyStore keystore, java.lang.String keyAlias, char[] password) throws java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.UnrecoverableKeyException
keystore
- keystore instancekeyAlias
- alias of entry containing private keypassword
- password to access entry
java.security.KeyStoreException
java.security.NoSuchAlgorithmException
java.security.UnrecoverableKeyException
public static java.security.cert.X509Certificate getX509Certificate(java.security.KeyStore keystore, java.lang.String keyAlias) throws java.security.KeyStoreException
keystore
- keystore instancekeyAlias
- alias of entry containing public certificate
java.security.KeyStoreException
public static byte[] base64Encode(byte[] bytes) throws java.io.IOException
bytes
-
java.io.IOException
public static byte[] base64Decode(byte[] b64EncodedBytes) throws java.io.IOException
b64EncodedBytes
-
java.io.IOException
public static java.lang.String convertBase64BytesToUrlSafeB64String(byte[] b64EncodedBytes) throws java.io.UnsupportedEncodingException
b64EncodedBytes
- base64 encoded bytes
java.io.UnsupportedEncodingException
public static byte[] convertUrlSafeB64StringToBase64Bytes(java.lang.String urlSafeB64String) throws java.io.UnsupportedEncodingException
urlSafeB64String
- URL parameter-value safe transformation of base64
data
java.io.UnsupportedEncodingException
public static java.util.List<java.security.cert.X509Certificate> getX509Certificates(java.security.KeyStore keystore) throws java.security.KeyStoreException
keystore
- keystore instance
java.security.KeyStoreException
public static java.util.List<java.security.cert.X509Certificate> getFilteredX509Certificates(java.security.KeyStore keystore, java.util.List<java.lang.String> excludedAliases, java.util.List<java.lang.String> includedAliases) throws java.security.KeyStoreException
keystore
- keystore instanceexcludedAliases
- excluded keystore aliases (lower-case)includedAliases
- included keystore aliases (lower-case)
java.security.KeyStoreException
public static java.util.Map<java.lang.String,java.security.cert.X509Certificate> getX509CertificatesMap(java.security.KeyStore keystore) throws java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.cert.CertificateEncodingException
keystore
- keystore instance
java.security.KeyStoreException
java.security.NoSuchAlgorithmException
java.security.cert.CertificateEncodingException
public static java.util.Map<java.lang.String,java.security.cert.X509Certificate> getFilteredX509CertificatesMap(java.security.KeyStore keystore, java.util.List<java.lang.String> excludedAliases, java.util.List<java.lang.String> includedAliases) throws java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.cert.CertificateEncodingException
keystore
- keystore instanceexcludedAliases
- excluded keystore aliases (lower-case)includedAliases
- included keystore aliases (lower-case)
java.security.KeyStoreException
java.security.NoSuchAlgorithmException
java.security.cert.CertificateEncodingException
public static java.lang.String getSHA1FingerPrint(java.security.cert.X509Certificate publicCert) throws java.security.NoSuchAlgorithmException, java.security.cert.CertificateEncodingException
publicCert
- public certificate
java.security.NoSuchAlgorithmException
java.security.cert.CertificateEncodingException
public static java.lang.String getMD5FingerPrint(java.security.cert.X509Certificate publicCert) throws java.security.NoSuchAlgorithmException, java.security.cert.CertificateEncodingException
publicCert
- public certificate
java.security.NoSuchAlgorithmException
java.security.cert.CertificateEncodingException
public static java.lang.String getFingerPrint(java.security.cert.X509Certificate publicCert, java.lang.String algorithm) throws java.security.NoSuchAlgorithmException, java.security.cert.CertificateEncodingException
publicCert
- public certificatealgorithm
- hash function algortihm
java.security.NoSuchAlgorithmException
java.security.cert.CertificateEncodingException
public static java.lang.String byteToHex(byte b)
b
- the byte to be converted to a hexadecimal string
|
Oracle Fusion Middleware extensions for Applications Core API Reference 11g Release 1 (11.1.1.5) E22562-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |