Interface EcDsaSignature
- All Known Implementing Classes:
ImmutableEcDsaSignature
@Immutable
public interface EcDsaSignature
A container for EcDSA signature content.
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()default UnsignedByteArrayder()Encode thisEcDsaSignatureto the ASN.1 DER format.static EcDsaSignaturefromDer(byte[] bytes) Create anEcDsaSignaturefrom a DER encoded byte array signature.default voidMake sure signature is canonical to protect against signature morphing attacks.r()The r component of thisEcDsaSignature.s()The s component of thisEcDsaSignature.
-
Method Details
-
builder
-
fromDer
Create anEcDsaSignaturefrom a DER encoded byte array signature.- Parameters:
bytes- A DER encoded byte array containing a signature.- Returns:
- An
EcDsaSignature.
-
r
BigInteger r()The r component of thisEcDsaSignature.- Returns:
- A
BigIntegerdenoting the r component of this signature.
-
s
BigInteger s()The s component of thisEcDsaSignature.- Returns:
- A
BigIntegerdenoting the r component of this signature.
-
der
Encode thisEcDsaSignatureto the ASN.1 DER format.- Returns:
- An
UnsignedByteArraycontaining the bytes of the encoded signature.
-
isStrictlyCanonical
@Check default void isStrictlyCanonical()Make sure signature is canonical to protect against signature morphing attacks.Signature should be:
<30> <len> [ <02> <lenR> <R> ] [ <02> <lenS> <S> ]where6 <= len <= 701 <= lenR <= 331 <= lenS <= 33
-