Package org.xipki.security.pkcs11
Class P11KeypairGenerator
- java.lang.Object
-
- org.xipki.security.KeypairGenerator
-
- org.xipki.security.pkcs11.P11KeypairGenerator
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class P11KeypairGenerator extends KeypairGenerator
PKCS#11P11KeypairGenerator.- Since:
- 6.0.0
- Author:
- Lijun Liao (xipki)
-
-
Field Summary
Fields Modifier and Type Field Description protected P11CryptServiceFactorycryptServiceFactoryprotected P11Slotslot-
Fields inherited from class org.xipki.security.KeypairGenerator
keyspecs, name, rsaE
-
-
Constructor Summary
Constructors Constructor Description P11KeypairGenerator(P11CryptServiceFactory cryptServiceFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()org.bouncycastle.asn1.pkcs.PrivateKeyInfogenerateKeypair(String keyspec)Generate keypair for the given keyspec as defined in RFC 5958.voidinitialize0(org.xipki.util.ConfPairs conf, org.xipki.password.PasswordResolver passwordResolver)booleanisHealthy()-
Methods inherited from class org.xipki.security.KeypairGenerator
getName, initialize, setName, supports
-
-
-
-
Field Detail
-
cryptServiceFactory
protected final P11CryptServiceFactory cryptServiceFactory
-
slot
protected P11Slot slot
-
-
Constructor Detail
-
P11KeypairGenerator
public P11KeypairGenerator(P11CryptServiceFactory cryptServiceFactory)
-
-
Method Detail
-
initialize0
public void initialize0(org.xipki.util.ConfPairs conf, org.xipki.password.PasswordResolver passwordResolver) throws XiSecurityException- Specified by:
initialize0in classKeypairGenerator- Throws:
XiSecurityException
-
generateKeypair
public org.bouncycastle.asn1.pkcs.PrivateKeyInfo generateKeypair(String keyspec) throws XiSecurityException
Description copied from class:KeypairGeneratorGenerate keypair for the given keyspec as defined in RFC 5958.- Specified by:
generateKeypairin classKeypairGenerator- Parameters:
keyspec- Key specification. It has the following format:- RSA: 'RSA/'<bit-length> or 'RSA/'<bit-length>
- DSA: 'DSA/'<bit-lenth of P>'/'<bit-lenth of Q>
- EC: 'EC/'<curve OID>
- EdDSA: 'ED25519' or 'ED448'
- XDH: 'X25519' or 'X448'
- Returns:
- the generated keypair.
- Throws:
XiSecurityException- if could not generate keypair.
-
isHealthy
public boolean isHealthy()
- Specified by:
isHealthyin classKeypairGenerator
-
close
public void close() throws IOException- Throws:
IOException
-
-