This module implements Signed Envelope.
Types
Envelope = object publicKey*: PublicKey domain*: string payloadType*: seq[byte] signature*: Signature
- Source Edit
EnvelopeError = enum EnvelopeInvalidProtobuf, EnvelopeFieldMissing, EnvelopeInvalidSignature, EnvelopeWrongType
- Source Edit
SignedPayload[T] = object envelope*: Envelope data*: T
- Source Edit
Procs
proc decode(T: typedesc[Envelope]; buf: seq[byte]; domain: string): Result[ Envelope, EnvelopeError] {....raises: [].}
- Source Edit
proc decode[T](__5402264239: typedesc[SignedPayload[T]]; buffer: seq[byte]): Result[ SignedPayload[T], EnvelopeError] {....raises: [].}
- Source Edit
proc encode(env: Envelope): Result[seq[byte], CryptoError] {....raises: [], tags: [], forbids: [].}
- Source Edit
proc encode[T](msg: SignedPayload[T]): Result[seq[byte], CryptoError] {. ...raises: [].}
- Source Edit
proc getField(pb: ProtoBuffer; field: int; value: var Envelope; domain: string): ProtoResult[ bool] {.inline, ...raises: [], tags: [RootEffect], forbids: [].}
- Source Edit
proc getField[T](pb: ProtoBuffer; field: int; value: var SignedPayload[T]): ProtoResult[ bool] {.inline, ...raises: [].}
- Source Edit
proc init(T: typedesc[Envelope]; privateKey: PrivateKey; payloadType: seq[byte]; payload: seq[byte]; domain: string): Result[Envelope, CryptoError] {. ...raises: [].}
- Source Edit
proc init[T](__5402264207: typedesc[SignedPayload[T]]; privateKey: PrivateKey; data: T): Result[SignedPayload[T], CryptoError] {....raises: [].}
- Source Edit
proc write(pb: var ProtoBuffer; field: int; env: Envelope): Result[void, CryptoError] {....raises: [], tags: [], forbids: [].}
- Source Edit
Exports
-
Signature, shortLog, toBytes, DigestSheme, ephemeral, decodeProposal, init, getRawBytes, sign, SupportedSchemesInt, macOpenArray, Secret, $, write, init, selectBest, init, ECDHEScheme, ephemeral, withValue, safeConvert, init, createExchange, init, withValue, public, init, getField, valueOr, init, toBytes, random, createProposal, init, getBytes, write, toOpt, init, newRng, toRawBytes, getPublicKey, init, random, init, exceptionToAssert, init, init, init, getField, iv, CryptoError, ==, verify, init, key, SupportedSchemes, RsaDefaultKeySize, toBytes, capLen, shuffle, supported, write, ==, libp2p_pki_schemes, random, getBytes, random, keyOpenArray, CryptoResult, stretchKeys, init, init, shortLog, init, PublicKey, mac, shortLog, PKScheme, init, PrivateKey, getBytes, ivOpenArray, write, compilesOr, orError, decodeExchange, $, write, goffset, getOrder, KeyPair