Class ECDSAEncoder

java.lang.Object
org.bouncycastle.its.operator.ECDSAEncoder

public class ECDSAEncoder extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.bouncycastle.oer.its.ieee1609dot2.basetypes.Signature
    toITS(org.bouncycastle.asn1.ASN1ObjectIdentifier curveID, byte[] dsaEncoding)
     
    static byte[]
    toX962(org.bouncycastle.oer.its.ieee1609dot2.basetypes.Signature signature)
    Return the X9.62 DER encoding of the r and s values in the passed in IEEE 1609.2 signature.
    static org.bouncycastle.oer.its.ieee1609dot2.basetypes.Signature
    toXOnly(org.bouncycastle.oer.its.ieee1609dot2.basetypes.Signature signature)
    Return the passed in IEEE 1609.2 signature with rSig in the form x-only.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ECDSAEncoder

      public ECDSAEncoder()
  • Method Details

    • toX962

      public static byte[] toX962(org.bouncycastle.oer.its.ieee1609dot2.basetypes.Signature signature)
      Return the X9.62 DER encoding of the r and s values in the passed in IEEE 1609.2 signature.

      IEEE 1609.2 (EcdsaP256Signature, EcdsaP384Signature) allows rSig to carry either the integer r, as the choice x-only, or the point R, as compressed-y-0, compressed-y-1 or uncompressed at the sender's discretion. In the latter case r is the x coordinate of R reduced mod n. The choice fill carries no r value and is rejected.

      Parameters:
      signature - the signature to convert.
      Returns:
      the DER encoded SEQUENCE of r and s.
    • toXOnly

      public static org.bouncycastle.oer.its.ieee1609dot2.basetypes.Signature toXOnly(org.bouncycastle.oer.its.ieee1609dot2.basetypes.Signature signature)
      Return the passed in IEEE 1609.2 signature with rSig in the form x-only.

      IEEE 1609.2 (EcdsaP256Signature, EcdsaP384Signature): "If this structure is encoded for hashing, the EccP256CurvePoint in rSig shall be taken to be of form x-only." - this is the form to use when a structure carrying a signature, such as a certificate, is hashed to calculate a HashedId8.

      Parameters:
      signature - the signature to convert.
      Returns:
      signature if rSig is already of form x-only, otherwise an equivalent signature with rSig of form x-only.
    • toITS

      public static org.bouncycastle.oer.its.ieee1609dot2.basetypes.Signature toITS(org.bouncycastle.asn1.ASN1ObjectIdentifier curveID, byte[] dsaEncoding)