- Direct Known Subclasses:
- Enclosing class:
public static class ECKey.ECDSASignature extends java.lang.ObjectGroups the two components that make up a signature, and provides a way to encode to DER form, which is how ECDSA signatures are represented when embedded in other data structures in the Bitcoin protocol. The raw components can be useful for doing further EC maths on them.
Constructors Constructor Description
ECDSASignature(java.math.BigInteger r, java.math.BigInteger s)Constructs a signature with the given components.
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description
encodeToDER()DER is an international standard for serializing data structures which is widely used in cryptography.
isCanonical()Returns true if the S component is "low", that means it is below
toCanonicalised()Will automatically adjust the S component to be less than or equal to half the curve order, if necessary.
public boolean isCanonical()Returns true if the S component is "low", that means it is below
ECKey.HALF_CURVE_ORDER. See BIP62.
public ECKey.ECDSASignature toCanonicalised()Will automatically adjust the S component to be less than or equal to half the curve order, if necessary. This is required because for every signature (r,s) the signature (r, -s (mod N)) is a valid signature of the same message. However, we dislike the ability to modify the bits of a Bitcoin transaction after it's been signed, as that violates various assumed invariants. Thus in future only one of those forms will be considered legal and the other will be banned.
public byte encodeToDER()DER is an international standard for serializing data structures which is widely used in cryptography. It's somewhat like protocol buffers but less convenient. This method returns a standard DER encoding of the signature, as recognized by OpenSSL and other libraries.
public static ECKey.ECDSASignature decodeFromDER(byte bytes) throws SignatureDecodeException
SignatureDecodeException- if the signature is unparseable in some way.
protected java.io.ByteArrayOutputStream derByteStream() throws java.io.IOException
public boolean equals(java.lang.Object o)
public int hashCode()