Package com.unboundid.util.ssl.cert
Class EllipticCurvePublicKey
- java.lang.Object
-
- com.unboundid.util.ssl.cert.DecodedPublicKey
-
- com.unboundid.util.ssl.cert.EllipticCurvePublicKey
-
- All Implemented Interfaces:
java.io.Serializable
@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class EllipticCurvePublicKey extends DecodedPublicKey
This class provides a data structure for representing the information contained in an elliptic curve public key in an X.509 certificate. As per RFC 5480 section 2.2, and the Standards for Efficient Cryptography SEC 1 document.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.math.BigInteger
getXCoordinate()
Retrieves the value of the x coordinate.java.math.BigInteger
getYCoordinate()
Retrieves the value of the y coordinate.void
toString(java.lang.StringBuilder buffer)
Appends a string representation of this decoded public key to the provided buffer.boolean
usesCompressedForm()
Indicates whether the public key uses the compressed form (which merely contains the x coordinate and an indication as to whether the y coordinate is even or odd) or the uncompressed form (which contains both the x and y coordinate values).boolean
yCoordinateIsEven()
Indicates whether the y coordinate is even or odd.-
Methods inherited from class com.unboundid.util.ssl.cert.DecodedPublicKey
toString
-
-
-
-
Method Detail
-
usesCompressedForm
public boolean usesCompressedForm()
Indicates whether the public key uses the compressed form (which merely contains the x coordinate and an indication as to whether the y coordinate is even or odd) or the uncompressed form (which contains both the x and y coordinate values).- Returns:
true
if the public key uses the compressed form, orfalse
if it uses the uncompressed form.
-
getXCoordinate
public java.math.BigInteger getXCoordinate()
Retrieves the value of the x coordinate. This will always be available.- Returns:
- The value of the x coordinate.
-
getYCoordinate
public java.math.BigInteger getYCoordinate()
Retrieves the value of the y coordinate. This will only be available if the key was encoded in the uncompressed form.- Returns:
- The value of the y coordinate, or
null
if the key was encoded in the compressed form.
-
yCoordinateIsEven
public boolean yCoordinateIsEven()
Indicates whether the y coordinate is even or odd.- Returns:
true
if the y coordinate is even, orfalse
if the y coordinate is odd.
-
toString
public void toString(java.lang.StringBuilder buffer)
Appends a string representation of this decoded public key to the provided buffer.- Specified by:
toString
in classDecodedPublicKey
- Parameters:
buffer
- The buffer to which the information should be appended.
-
-