package key-parsers

  1. Overview
  2. Docs

The format for private keys is:

  • 4 bytes: size of d encoded in big endian
  • d
  • 3 bytes: e (0x01 0x00 0x01)
  • p
  • q

d, p and q are encoded with a leading 0x00. The size of p and q is determined from that of d (|p| = |q| = |d|/2 + 1).

The format is a bit ambiguous if e is not 0x010001, so an error will be raised in that case.

type t = {
  1. e : Z.t;
  2. d : Z.t;
  3. p : Z.t;
  4. q : Z.t;
}
val equal : t -> t -> Ppx_deriving_runtime.bool
val compare : t -> t -> Ppx_deriving_runtime.int
val pp : Ppx_deriving_runtime.Format.formatter -> t -> Ppx_deriving_runtime.unit
val show : t -> Ppx_deriving_runtime.string
val bin_t : t Bin_prot.Type_class.t0
  • deprecated Bin_prot serializers will be removed in key-parsers 1.0.0
val bin_size_t : t -> int
  • deprecated Bin_prot serializers will be removed in key-parsers 1.0.0
val bin_read_t : Bin_prot.Common.buf -> pos_ref:Bin_prot.Common.pos_ref -> t
  • deprecated Bin_prot serializers will be removed in key-parsers 1.0.0
val bin_write_t : Bin_prot.Common.buf -> pos:int -> t -> int
  • deprecated Bin_prot serializers will be removed in key-parsers 1.0.0
val bin_shape_t : Bin_prot.Shape.t
  • deprecated Bin_prot serializers will be removed in key-parsers 1.0.0
val bin_reader_t : t Bin_prot.Type_class.reader0
  • deprecated Bin_prot serializers will be removed in key-parsers 1.0.0
val bin_writer_t : t Bin_prot.Type_class.writer0
  • deprecated Bin_prot serializers will be removed in key-parsers 1.0.0
val to_yojson : t -> Yojson.Safe.json
  • deprecated Yojson serializers will be removed in key-parsers 1.0.0
val of_yojson : Yojson.Safe.json -> (t, string) Stdlib.result
  • deprecated Yojson serializers will be removed in key-parsers 1.0.0
val decode : Cstruct.t -> (t, string) Result.result
OCaml

Innovation. Community. Security.