public class KeyUtil extends Object
KeyUtil
provides methods to obtain
the hosting entity's signing key and decryption key, and
to obtain a partner entity's signature verification key
and encryption related informationModifier and Type | Field and Description |
---|---|
protected static Hashtable |
encHash |
protected static Map<String,Set<X509Certificate>> |
sigHash |
Modifier and Type | Method and Description |
---|---|
static void |
clear()
Clears the cache.
|
static X509Certificate |
getCert(KeyDescriptorType kd)
Returns certificate stored in
KeyDescriptorType . |
static PrivateKey |
getDecryptionKey(BaseConfigType baseConfig)
Returns the host entity's decryption key.
|
static Set<PrivateKey> |
getDecryptionKeys(BaseConfigType baseConfig)
Returns the host entity's decryption keys.
|
static Set<PrivateKey> |
getDecryptionKeys(String realm,
String entityID,
String role)
Returns the hosted entity's decryption keys.
|
static EncInfo |
getEncInfo(RoleDescriptorType roled,
String entityID,
String role)
Returns the encryption information which will be used in
encrypting messages intended for the partner entity.
|
static KeyDescriptorType |
getKeyDescriptor(RoleDescriptorType roled,
String usage)
Returns
KeyDescriptorType from
RoleDescriptorType . |
static List<KeyDescriptorType> |
getKeyDescriptors(RoleDescriptorType roleDescriptor,
String usage)
Returns the
KeyDescriptorType s from RoleDescriptorType that matches the requested usage. |
static KeyProvider |
getKeyProviderInstance()
Returns the instance of
KeyProvider . |
static Set<X509Certificate> |
getPDPVerificationCerts(XACMLPDPDescriptorElement pdpDescriptor,
String entityID)
Returns the partner entity's signature verification certificates.
|
static EncInfo |
getPEPEncInfo(XACMLAuthzDecisionQueryDescriptorElement pepDesc,
String pepEntityID)
Returns the encryption information which will be used in
encrypting messages intended for the partner entity.
|
static Set<X509Certificate> |
getPEPVerificationCerts(XACMLAuthzDecisionQueryDescriptorElement pepDescriptor,
String entityID)
Returns the partner entity's signature verification certificates.
|
static String |
getSigningCertAlias(BaseConfigType baseConfig)
Returns the host entity's signing certificate alias.
|
static Set<X509Certificate> |
getVerificationCerts(RoleDescriptorType roleDescriptor,
String entityID,
String role)
Returns the partner entity's signature verification certificate.
|
protected static Hashtable encHash
protected static Map<String,Set<X509Certificate>> sigHash
public static KeyProvider getKeyProviderInstance()
KeyProvider
.KeyProvider
public static String getSigningCertAlias(BaseConfigType baseConfig)
baseConfig
- BaseConfigType
for the host entityString
for host entity's signing
certificate aliaspublic static Set<PrivateKey> getDecryptionKeys(String realm, String entityID, String role)
realm
- The realm the hosted entity belongs to.entityID
- The entity ID.role
- The role of the hosted entity.PrivateKey
s for decrypting a message received by the hosted entity.public static Set<PrivateKey> getDecryptionKeys(BaseConfigType baseConfig)
baseConfig
- BaseConfigType
for the host entity.PrivateKey
s for decrypting a message received by the hosted entity.public static PrivateKey getDecryptionKey(BaseConfigType baseConfig)
baseConfig
- BaseConfigType
for the host entityPrivateKey
for decrypting a message received
by the host entitypublic static Set<X509Certificate> getVerificationCerts(RoleDescriptorType roleDescriptor, String entityID, String role)
roleDescriptor
- RoleDescriptor
for the partner entity.entityID
- Partner entity's ID.role
- Entity's role.X509Certificate
for verifying the partner entity's signature.public static EncInfo getEncInfo(RoleDescriptorType roled, String entityID, String role)
roled
- RoleDescriptor
for the partner entityentityID
- partner entity's IDrole
- entity's roleEncInfo
which includes partner entity's
public key for wrapping the secret key, data encryption algorithm,
and data encryption strengthpublic static List<KeyDescriptorType> getKeyDescriptors(RoleDescriptorType roleDescriptor, String usage)
KeyDescriptorType
s from RoleDescriptorType
that matches the requested usage.
KeyDescriptors without usage defined are also included in this list, as by definition they should be suitable for
any purposes.roleDescriptor
- RoleDescriptorType
which contains KeyDescriptorType
s.usage
- Type of the KeyDescriptorType
s to be retrieved. Its value is "encryption" or "signing".KeyDescriptorType
s in RoleDescriptorType
that matched the usage type.public static KeyDescriptorType getKeyDescriptor(RoleDescriptorType roled, String usage)
KeyDescriptorType
from
RoleDescriptorType
.roled
- RoleDescriptorType
which contains
KeyDescriptor
s.usage
- type of the KeyDescriptorType
to be retrieved.
Its value is "encryption" or "signing".RoleDescriptorType
that matched
the usage type.public static X509Certificate getCert(KeyDescriptorType kd)
KeyDescriptorType
.kd
- KeyDescriptorType
which contains certificate infoKeyDescriptorType
; or
null
if no certificate is included.public static Set<X509Certificate> getPEPVerificationCerts(XACMLAuthzDecisionQueryDescriptorElement pepDescriptor, String entityID)
pepDescriptor
- XACMLAuthzDecisionQueryDescriptorElement
for the partner entity.entityID
- Policy Enforcement Point (PEP) entity identifier.X509Certificate
s for verifying the partner entity's signature.public static EncInfo getPEPEncInfo(XACMLAuthzDecisionQueryDescriptorElement pepDesc, String pepEntityID)
pepDesc
- XACMLAuthzDecisionQueryDescriptorElement
for the partner entitypepEntityID
- partner entity's IDEncInfo
which includes partner entity's
public key for wrapping the secret key, data encryption algorithm,
and data encryption strengthpublic static Set<X509Certificate> getPDPVerificationCerts(XACMLPDPDescriptorElement pdpDescriptor, String entityID)
pdpDescriptor
- XACMLPDPDescriptorElement
of partner entity.entityID
- partner entity's ID.X509Certificate
s for verifying the partner entity's signature.public static void clear()
Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.