public class BIDFactory extends Object
Modifier and Type | Field and Description |
---|---|
static boolean |
cryptokiAlreadyLoaded |
static boolean |
LOG4J_INITIALIZED |
static String |
PKCS11DRIVER |
Modifier and Type | Method and Description |
---|---|
ContextInfo |
addGrantedPolicyIdentifier(String merchantName,
String policyOID)
This method allows merchants to add a certificate policy oid to the already configured
granted policies list in the merchant context identified by the input merchantName.
|
ContextInfo |
getContextInfo(String merchantName)
Returns an instance of no.bbs.server.vos.ContextInfo containing context-specific
information for the given merchantName.
|
BIDFacade |
getFacade(String merchantName)
Returns a BIDFacade instance for the input merchant context.
|
static BIDFactory |
getInstance()
Returns the BIDFactory singleton instance.
|
String |
getNativeCryptokiVersion()
This method returns the NativeCryptoki.dll (or .so) version.
|
String[] |
getRegisteredMerchantNames()
Returns a String[] of all merchant names that have a BankIDContext registered
in BankID Server.
|
String |
getSlotLoggedInSession(int slotId)
Returns the HSM LoggedInSession identifier for the given slotId.
|
ContextInfo |
loadBankIDContext(String configFilePath,
String merchantName,
String passphrase)
Loads the configuration file merchantName.props and returns and instance of
ContextInfo.
|
void |
loadPKCS11Adapter(String nativeCryptoki,
String p11Driver)
Method to load a PKCS#11 driver.
|
ContextInfo |
registerBankIDContext(MerchantConfig merchantConfig)
Method to register and initialize a BankIDServer context without needing any property-/configuration-
files.
|
void |
removeBankIDContext(String merchantName)
Method to remove a merchants BankIDServer Context in runtime.
|
ContextInfo |
removeGrantedPolicyIdentifier(String merchantName,
String policyOID)
Through this method a merchant can remove already configured granted policies from
it BankIDServer context.
|
void |
setSlotLoggedInSession(int slotId,
long loggedInSession)
Sets the HSM LoggedInSession identifier for the given slotid
|
public static boolean cryptokiAlreadyLoaded
public static boolean LOG4J_INITIALIZED
public static String PKCS11DRIVER
public static BIDFactory getInstance()
public String getSlotLoggedInSession(int slotId)
slotId
- int The slotId to checkpublic void setSlotLoggedInSession(int slotId, long loggedInSession)
slotId
- int The slotId to addloggedInSession
- long the HSM LoggedInSession identifier for the given slotidpublic String getNativeCryptokiVersion() throws BIDException
BIDException
- If something fails or if loadPKCS11Adapter(...) has not been called firstpublic void loadPKCS11Adapter(String nativeCryptoki, String p11Driver) throws BIDException
p11Driver
- String holding the path to a PKCS#11 driver (dll or so file)nativeCryptoki
- String holding the fully qualified path to NativeCryptoki.dll (.so). This is the
BankID JNI interface to the input PCKS#11 driver/adapter.BIDException
- If the input p11driver is null or failed to load PKCS#11 driver.public BIDFacade getFacade(String merchantName) throws BIDException
merchantName
- The unique name that identifies a merchant context in BankID Server.BIDException
- If the context is missing or input is nullpublic ContextInfo registerBankIDContext(MerchantConfig merchantConfig) throws BIDException
merchantConfig
- MerchantConfig instance identifying the merchant context to create.
The merchant name in the MerchantConfig is the key that uniquely identifies
a merchant in BankID Server.BIDException
- If registering a BankID Merchant context fails. Some reason for failure may be:public void removeBankIDContext(String merchantName) throws BIDException
merchantName
- String The merchantName that the context was registered as.BIDException
- If the input merchantName is nullpublic String[] getRegisteredMerchantNames()
public ContextInfo loadBankIDContext(String configFilePath, String merchantName, String passphrase) throws BIDException
configFilePath
- String telling BankIDServer which directory to find the merchantName.props file
NB! If this parameter value is null then the merchantName.props MUST be in
BankIDServer's classpath.merchantName
- String The merchantName and the prefix of the merchants config filepassphrase
- String The merchant keystore passphraseBIDException
- If loading or verifying the context configuration file failspublic ContextInfo addGrantedPolicyIdentifier(String merchantName, String policyOID) throws BIDException
merchantName
- String The merchant context identifier.policyOID
- String The policyOID to add to the granted policies listBIDException
- If the merchantName does not exists or the input data is null or invalidpublic ContextInfo removeGrantedPolicyIdentifier(String merchantName, String policyOID) throws BIDException
merchantName
- String The key that identifies tke merchant context to manipulatepolicyOID
- String The certificate policy oid to remove from the granted policies listBIDException
- If the merchantName is not registered or the input data is null or invalidpublic ContextInfo getContextInfo(String merchantName)
merchantName
- String The key merchant-context-identifierCopyright © 2017 Nets Branch Norway. All Rights Reserved.