package com.sun.identity.saml2.xmlenc;

import com.sun.identity.saml2.common.SAML2SDKUtils;
import com.sun.identity.shared.configuration.SystemPropertiesManager;

public final class EncManager {
   private static EncProvider ep;

   private EncManager() {
   }

   public static EncProvider getEncInstance() {
      return ep;
   }

   static {
      try {
         String encryptClass = SystemPropertiesManager.get("com.sun.identity.saml2.xmlenc.EncryptionProvider", "com.sun.identity.saml2.xmlenc.FMEncProvider");
         ep = (EncProvider)Class.forName(encryptClass).getDeclaredConstructor().newInstance();
      } catch (Exception e) {
         SAML2SDKUtils.DEBUG.error("EncManager static block: Exception in constructing xml encryption manager", e);
      }
   }
}
