Class KeyUtil


  • public class KeyUtil
    extends Object
    The 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 information
    • Method Detail

      • getKeyProviderInstance

        public static KeyProvider getKeyProviderInstance()
        Returns the instance of KeyProvider.
        Returns:
        KeyProvider
      • getSigningCertAlias

        public static String getSigningCertAlias​(BaseConfigType baseConfig)
        Returns the host entity's signing certificate alias.
        Parameters:
        baseConfig - BaseConfigType for the host entity
        Returns:
        String for host entity's signing certificate alias
      • getDecryptionKey

        public static PrivateKey getDecryptionKey​(BaseConfigType baseConfig)
        Returns the host entity's decryption key.
        Parameters:
        baseConfig - BaseConfigType for the host entity
        Returns:
        PrivateKey for decrypting a message received by the host entity
      • getVerificationCert

        public static X509Certificate getVerificationCert​(FederationElement fed,
                                                          String entityID,
                                                          boolean isIDP)
        Returns the partner entity's signature verification certificate.
        Parameters:
        fed - FederationElement for the partner entity
        entityID - partner entity's ID
        isIDP - whether partner entity's role is IDP or SP
        Returns:
        X509Certificate for verifying the partner entity's signature
      • getCert

        public static X509Certificate getCert​(FederationElement fed)
        Returns certificate stored in FederationElement.
        Parameters:
        fed - FederationElement which contains certificate info
        Returns:
        X509Certificate contained in FederationElement; or null if no certificate is included.