Package org.xipki.security.pkcs11
Class P11CryptServiceFactoryImpl
- java.lang.Object
-
- org.xipki.security.pkcs11.P11CryptServiceFactoryImpl
-
- All Implemented Interfaces:
Closeable,AutoCloseable,P11CryptServiceFactory
public class P11CryptServiceFactoryImpl extends Object implements P11CryptServiceFactory
An implementation ofP11CryptServiceFactory.- Since:
- 2.0.0
- Author:
- Lijun Liao (xipki)
-
-
Field Summary
-
Fields inherited from interface org.xipki.security.pkcs11.P11CryptServiceFactory
DEFAULT_P11MODULE_NAME
-
-
Constructor Summary
Constructors Constructor Description P11CryptServiceFactoryImpl(P11ModuleFactoryRegister p11ModuleFactoryRegister)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Set<String>getModuleNames()P11CryptServicegetP11CryptService(String moduleName)Gets theP11CryptServiceof the given modulemoduleName.voidinit()voidsetPasswordResolver(org.xipki.password.PasswordResolver passwordResolver)voidsetPkcs11Conf(Pkcs11conf conf)voidsetPkcs11ConfFile(String confFile)
-
-
-
Constructor Detail
-
P11CryptServiceFactoryImpl
public P11CryptServiceFactoryImpl(P11ModuleFactoryRegister p11ModuleFactoryRegister)
-
-
Method Detail
-
init
public void init() throws org.xipki.util.exception.InvalidConfException- Throws:
org.xipki.util.exception.InvalidConfException
-
getP11CryptService
public P11CryptService getP11CryptService(String moduleName) throws XiSecurityException, org.xipki.pkcs11.wrapper.TokenException
Description copied from interface:P11CryptServiceFactoryGets theP11CryptServiceof the given modulemoduleName.- Specified by:
getP11CryptServicein interfaceP11CryptServiceFactory- Parameters:
moduleName- Module name.nullfor default module name.- Returns:
- the
P11CryptServiceof the given module. - Throws:
XiSecurityException- if security error occurs.org.xipki.pkcs11.wrapper.TokenException- if PKCS#11 token error occurs.
-
setPkcs11ConfFile
public void setPkcs11ConfFile(String confFile)
-
setPkcs11Conf
public void setPkcs11Conf(Pkcs11conf conf) throws org.xipki.util.exception.InvalidConfException
- Throws:
org.xipki.util.exception.InvalidConfException
-
setPasswordResolver
public void setPasswordResolver(org.xipki.password.PasswordResolver passwordResolver)
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
getModuleNames
public Set<String> getModuleNames()
- Specified by:
getModuleNamesin interfaceP11CryptServiceFactory
-
-