Class SoftwareKeypairGenerator

  • All Implemented Interfaces:
    Closeable, AutoCloseable

    public class SoftwareKeypairGenerator
    extends KeypairGenerator
    Software-based keypair generator.
    Since:
    6.0.0
    Author:
    Lijun Liao (xipki)
    • Constructor Detail

      • SoftwareKeypairGenerator

        public SoftwareKeypairGenerator​(SecureRandom random)
    • Method Detail

      • initialize0

        public void initialize0​(org.xipki.util.ConfPairs conf,
                                org.xipki.password.PasswordResolver passwordResolver)
        Specified by:
        initialize0 in class KeypairGenerator
      • generateKeypair

        public org.bouncycastle.asn1.pkcs.PrivateKeyInfo generateKeypair​(String keyspec)
                                                                  throws XiSecurityException
        Description copied from class: KeypairGenerator
        Generate keypair for the given keyspec as defined in RFC 5958.
        Specified by:
        generateKeypair in class KeypairGenerator
        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.