Package com.sun.identity.federation.key
Class KeyUtil
- java.lang.Object
-
- com.sun.identity.federation.key.KeyUtil
-
public class KeyUtil extends Object
TheKeyUtilprovides 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 information
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static X509CertificategetCert(com.sun.identity.liberty.ws.meta.jaxb.KeyDescriptorType kd)Returns certificate stored inKeyDescriptorType.static X509CertificategetCert(com.sun.identity.liberty.ws.meta.jaxb.ProviderDescriptorType providerDescriptor, String usage)Returns certificate stored inKeyDescriptorTypeinProviderDescriptorType.static PrivateKeygetDecryptionKey(com.sun.identity.federation.jaxb.entityconfig.BaseConfigType baseConfig)Returns the host entity's decryption key.static EncInfogetEncInfo(com.sun.identity.liberty.ws.meta.jaxb.ProviderDescriptorType providerDescriptor, String entityID, boolean isIDP)Returns the encryption information which will be used in encrypting messages intended for the partner entity.static com.sun.identity.liberty.ws.meta.jaxb.KeyDescriptorTypegetKeyDescriptor(com.sun.identity.liberty.ws.meta.jaxb.ProviderDescriptorType providerDescriptor, String usage)ReturnsKeyDescriptorTypefromProviderDescriptorType.static KeyProvidergetKeyProviderInstance()Returns the instance ofKeyProvider.static StringgetSigningCertAlias(com.sun.identity.federation.jaxb.entityconfig.BaseConfigType baseConfig)Returns the host entity's signing certificate alias.static X509CertificategetVerificationCert(com.sun.identity.liberty.ws.meta.jaxb.ProviderDescriptorType providerDescriptor, String entityID, boolean isIDP)Returns the partner entity's signature verification certificate.
-
-
-
Method Detail
-
getKeyProviderInstance
public static KeyProvider getKeyProviderInstance()
Returns the instance ofKeyProvider.- Returns:
KeyProvider
-
getSigningCertAlias
public static String getSigningCertAlias(com.sun.identity.federation.jaxb.entityconfig.BaseConfigType baseConfig)
Returns the host entity's signing certificate alias.- Parameters:
baseConfig-BaseConfigTypefor the host entity- Returns:
Stringfor host entity's signing certificate alias
-
getDecryptionKey
public static PrivateKey getDecryptionKey(com.sun.identity.federation.jaxb.entityconfig.BaseConfigType baseConfig)
Returns the host entity's decryption key.- Parameters:
baseConfig-BaseConfigTypefor the host entity- Returns:
PrivateKeyfor decrypting a message received by the host entity
-
getVerificationCert
public static X509Certificate getVerificationCert(com.sun.identity.liberty.ws.meta.jaxb.ProviderDescriptorType providerDescriptor, String entityID, boolean isIDP)
Returns the partner entity's signature verification certificate.- Parameters:
providerDescriptor-ProviderDescriptorTypefor the partner entityentityID- partner entity's IDisIDP- whether partner entity's role is IDP or SP- Returns:
X509Certificatefor verifying the partner entity's signature
-
getEncInfo
public static EncInfo getEncInfo(com.sun.identity.liberty.ws.meta.jaxb.ProviderDescriptorType providerDescriptor, String entityID, boolean isIDP)
Returns the encryption information which will be used in encrypting messages intended for the partner entity.- Parameters:
providerDescriptor-ProviderDescriptorTypefor the partner entityentityID- partner entity's IDisIDP- whether partner entity's role is IDP or SP- Returns:
EncInfowhich includes partner entity's public key for wrapping the secret key, data encryption algorithm, and data encryption strength
-
getKeyDescriptor
public static com.sun.identity.liberty.ws.meta.jaxb.KeyDescriptorType getKeyDescriptor(com.sun.identity.liberty.ws.meta.jaxb.ProviderDescriptorType providerDescriptor, String usage)ReturnsKeyDescriptorTypefromProviderDescriptorType.- Parameters:
providerDescriptor-ProviderDescriptorTypewhich containsKeyDescriptors.usage- type of theKeyDescriptorTypeto be retrieved. Its value is "encryption" or "signing".- Returns:
- KeyDescriptorType in
ProviderDescriptorTypethat matched the usage type.
-
getCert
public static X509Certificate getCert(com.sun.identity.liberty.ws.meta.jaxb.ProviderDescriptorType providerDescriptor, String usage)
Returns certificate stored inKeyDescriptorTypeinProviderDescriptorType.- Parameters:
providerDescriptor-ProviderDescriptorTypewhich containsKeyDescriptors.usage- type of theKeyDescriptorTypeto be retrieved. Its value is "encryption" or "signing".- Returns:
- X509Certificate contained in
KeyDescriptorType; ornullif no certificate is included.
-
getCert
public static X509Certificate getCert(com.sun.identity.liberty.ws.meta.jaxb.KeyDescriptorType kd)
Returns certificate stored inKeyDescriptorType.- Parameters:
kd-KeyDescriptorTypewhich contains certificate info- Returns:
- X509Certificate contained in
KeyDescriptorType; ornullif no certificate is included.
-
-