Package org.xipki.security
Class KeypairGenerator
- java.lang.Object
-
- org.xipki.security.KeypairGenerator
-
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
P11KeypairGenerator,SoftwareKeypairGenerator
public abstract class KeypairGenerator extends Object implements Closeable
Concurrent keypair generator.- Since:
- 6.0.0
- Author:
- Lijun Liao (xipki)
-
-
Constructor Summary
Constructors Constructor Description KeypairGenerator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract org.bouncycastle.asn1.pkcs.PrivateKeyInfogenerateKeypair(String keyspec)Generate keypair for the given keyspec as defined in RFC 5958.StringgetName()voidinitialize(String conf, org.xipki.password.PasswordResolver passwordResolver)Initializes me.protected abstract voidinitialize0(org.xipki.util.ConfPairs conf, org.xipki.password.PasswordResolver passwordResolver)abstract booleanisHealthy()voidsetName(String name)booleansupports(String keyspec)
-
-
-
Field Detail
-
name
protected String name
-
rsaE
protected BigInteger rsaE
-
-
Method Detail
-
getName
public String getName()
-
setName
public void setName(String name)
-
initialize
public void initialize(String conf, org.xipki.password.PasswordResolver passwordResolver) throws XiSecurityException
Initializes me.- Parameters:
conf- Configuration. Could benull.passwordResolver- Password resolver. Could benull.- Throws:
XiSecurityException- if error during the initialization occurs.
-
initialize0
protected abstract void initialize0(org.xipki.util.ConfPairs conf, org.xipki.password.PasswordResolver passwordResolver) throws XiSecurityException- Throws:
XiSecurityException
-
supports
public boolean supports(String keyspec)
-
generateKeypair
public abstract org.bouncycastle.asn1.pkcs.PrivateKeyInfo generateKeypair(String keyspec) throws XiSecurityException
Generate keypair for the given keyspec as defined in RFC 5958.- 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 abstract boolean isHealthy()
-
-