Package com.browserup.bup.mitm.keys
Class ECKeyGenerator
- java.lang.Object
-
- com.browserup.bup.mitm.keys.ECKeyGenerator
-
- All Implemented Interfaces:
KeyGenerator
public class ECKeyGenerator extends java.lang.Object implements KeyGenerator
AKeyGeneratorthat creates Elliptic Curve key pairs.
-
-
Constructor Summary
Constructors Constructor Description ECKeyGenerator()Create aKeyGeneratorthat will create EC key pairs using the secp256r1 named curve (NIST P-256) supported by modern web browsers.ECKeyGenerator(java.lang.String namedCurve)Create aKeyGeneratorthat will create EC key pairs using the specified named curve.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.security.KeyPairgenerate()Generates a new public/private key pair.java.lang.StringtoString()
-
-
-
Constructor Detail
-
ECKeyGenerator
public ECKeyGenerator()
Create aKeyGeneratorthat will create EC key pairs using the secp256r1 named curve (NIST P-256) supported by modern web browsers.
-
ECKeyGenerator
public ECKeyGenerator(java.lang.String namedCurve)
Create aKeyGeneratorthat will create EC key pairs using the specified named curve.- Parameters:
namedCurve- namedCurve
-
-
Method Detail
-
generate
public java.security.KeyPair generate()
Description copied from interface:KeyGeneratorGenerates a new public/private key pair. This method should not cache or reuse any previously-generated key pairs.- Specified by:
generatein interfaceKeyGenerator- Returns:
- a new public/private key pair
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-