public class ECPublicKeyNamedCurveSpec extends Object implements KeySpec
To generate a key using this spec:
String curveName = "secp256r1";
BigInteger x = ...
BigInteger y = ...
ECPublicKeyNamedCurveSpec keySpec = new ECPublicKeyNamedCurveSpec(curveName, x.toByteArray(), y.toByteArray());
PublicKey ecPublicKey = KeyFactory.getInstance("EC").generatePublic(keySpec);
KeyFactory| Constructor and Description |
|---|
ECPublicKeyNamedCurveSpec(String curveName,
byte[] x,
byte[] y)
Creates a new
ECPublicKeyNamedCurveSpec with the specified parameter values. |
| Modifier and Type | Method and Description |
|---|---|
String |
getCurveName()
Returns the elliptic curve name.
|
byte[] |
getX()
Returns the affine x-coordinate of the associated point.
|
byte[] |
getY()
Returns the affine y-coordinate of the associated point.
|
public ECPublicKeyNamedCurveSpec(String curveName, byte[] x, byte[] y)
ECPublicKeyNamedCurveSpec with the specified parameter values.curveName - the name of the elliptic curve.x - the affine x-coordinate of the associated point.y - the affine y-coordinate of the associated point.public String getCurveName()
public byte[] getX()
public byte[] getY()