Options
All
  • Public
  • Public/Protected
  • All
Menu

@ndn/ndncert

This package is part of NDNts, Named Data Networking libraries for the modern web.

This package partially implements NDN Certificate Management protocol v0.3.

  • crypto operations
  • messages
    • CA profile (segmentation not supported)
    • PROBE request
    • PROBE response
    • NEW request
    • NEW response
    • CHALLENGE request
    • CHALLENGE response
    • error messages
  • server
    • publish CA profile with RDR
    • probe
    • basic issuance workflow
    • PIN challenge
    • email challenge
    • proof of credential challenge
    • proof of private key challenge
    • publish certificate
    • proper error messages
  • client
    • probe
    • basic issuance workflow
    • PIN challenge
    • email challenge
    • proof of credential challenge
    • proof of private key challenge
    • retrieve certificate
    • handle error messages

@ndn/keychain-cli package offers ndntssec ndncert03-profile, ndntssec ndncert03-ca, ndntssec ndncert03-client commands that use this implementation.

Index

References

Namespaces

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Object literals

References

CaProfile

Re-exports CaProfile

CaProfile

Re-exports CaProfile

CaProfile

Re-exports CaProfile

ChallengeRequest

Re-exports ChallengeRequest

ChallengeRequest

Re-exports ChallengeRequest

ChallengeRequest

Re-exports ChallengeRequest

ChallengeResponse

Re-exports ChallengeResponse

ChallengeResponse

Re-exports ChallengeResponse

ChallengeResponse

Re-exports ChallengeResponse

ClientChallenge

Re-exports ClientChallenge

ClientChallenge

Re-exports ClientChallenge

ClientChallenge

Re-exports ClientChallenge

ClientChallengeContext

Re-exports ClientChallengeContext

ClientChallengeContext

Re-exports ClientChallengeContext

ClientChallengeContext

Re-exports ClientChallengeContext

ClientChallengeStartContext

Re-exports ClientChallengeStartContext

ClientChallengeStartContext

Re-exports ClientChallengeStartContext

ClientChallengeStartContext

Re-exports ClientChallengeStartContext

ClientNopChallenge

Re-exports ClientNopChallenge

ClientNopChallenge

Re-exports ClientNopChallenge

ClientNopChallenge

Re-exports ClientNopChallenge

ClientOptions

Re-exports ClientOptions

ClientOptions

Re-exports ClientOptions

ClientOptions

Re-exports ClientOptions

ClientPinChallenge

Re-exports ClientPinChallenge

ClientPinChallenge

Re-exports ClientPinChallenge

ClientPinChallenge

Re-exports ClientPinChallenge

ErrorCode

Re-exports ErrorCode

ErrorCode

Re-exports ErrorCode

ErrorCode

Re-exports ErrorCode

ErrorMsg

Re-exports ErrorMsg

ErrorMsg

Re-exports ErrorMsg

ErrorMsg

Re-exports ErrorMsg

NewRequest

Re-exports NewRequest

NewRequest

Re-exports NewRequest

NewRequest

Re-exports NewRequest

NewResponse

Re-exports NewResponse

NewResponse

Re-exports NewResponse

NewResponse

Re-exports NewResponse

ParameterKV

Re-exports ParameterKV

ParameterKV

Re-exports ParameterKV

ParameterKV

Re-exports ParameterKV

Server

Re-exports Server

Server

Re-exports Server

Server

Re-exports Server

ServerChallenge

Re-exports ServerChallenge

ServerChallenge

Re-exports ServerChallenge

ServerChallenge

Re-exports ServerChallenge

ServerChallengeContext

Re-exports ServerChallengeContext

ServerChallengeContext

Re-exports ServerChallengeContext

ServerChallengeContext

Re-exports ServerChallengeContext

ServerChallengeResponse

Re-exports ServerChallengeResponse

ServerChallengeResponse

Re-exports ServerChallengeResponse

ServerChallengeResponse

Re-exports ServerChallengeResponse

ServerNopChallenge

Re-exports ServerNopChallenge

ServerNopChallenge

Re-exports ServerNopChallenge

ServerNopChallenge

Re-exports ServerNopChallenge

ServerOptions

Re-exports ServerOptions

ServerOptions

Re-exports ServerOptions

ServerOptions

Re-exports ServerOptions

ServerPinChallenge

Re-exports ServerPinChallenge

ServerPinChallenge

Re-exports ServerPinChallenge

ServerPinChallenge

Re-exports ServerPinChallenge

Status

Re-exports Status

Status

Re-exports Status

Status

Re-exports Status

TT

Re-exports TT

TT

Re-exports TT

TT

Re-exports TT

Verb

Re-exports Verb

Verb

Re-exports Verb

Verb

Re-exports Verb

crypto

crypto:

crypto

crypto:

requestCertificate

Re-exports requestCertificate

requestCertificate

Re-exports requestCertificate

requestCertificate

Re-exports requestCertificate

Type aliases

ParameterKV

ParameterKV: Record<string, Uint8Array>

Parameter key-value pair.

Variables

Const BEFORE_CHALLENGE_EXPIRY

BEFORE_CHALLENGE_EXPIRY: 60000 = 60000

Const EVD

EVD: EvDecoder<Fields> = new EvDecoder<CaProfile.Fields>("CaProfile", undefined).add(TT.CaPrefix, (t, { vd }) => t.prefix = vd.decode(Name), { required: true }).add(TT.CaInfo, (t, { text }) => t.info = text, { required: true }).add(TT.ParameterKey, (t, { text }) => t.probeKeys.push(text), { repeat: true }).add(TT.MaxValidityPeriod, (t, { nni }) => t.maxValidityPeriod = nni * 1000, { required: true }).add(TT.CaCertificate, (t, { vd }) => t.cert = Certificate.fromData(vd.decode(Data)), { required: true })

Const EVD

EVD: EvDecoder<Fields> = new EvDecoder<NewRequest.Fields>("NewRequest", undefined).add(TT.EcdhPub, (t, { value }) => t.ecdhPubRaw = value, { required: true }).add(TT.CertRequest, (t, { vd }) => t.certRequest = Certificate.fromData(vd.decode(Data)), { required: true })

Const EVD

EVD: EvDecoder<Fields> = new EvDecoder<NewResponse.Fields>("NewResponse", undefined).add(TT.EcdhPub, (t, { value }) => t.ecdhPubRaw = value, { required: true }).add(TT.Salt, (t, { value }) => t.salt = value, { required: true }).add(TT.RequestId, (t, { value }) => t.requestId = value, { required: true }).add(TT.Challenge, (t, { text }) => t.challenges.push(text), { required: true, repeat: true })

Const EVD

EVD: EvDecoder<Params> = new EvDecoder<LLDecrypt.Params>("EncryptedPayload", undefined).add(TT.InitializationVector, (t, { value }) => t.iv = value, { required: true }).add(TT.AuthenticationTag, (t, { value }) => t.authenticationTag = value, { required: true }).add(TT.EncryptedPayload, (t, { value }) => t.ciphertext = value, { required: true })

Const EVD

EVD: EvDecoder<Fields> = new EvDecoder<ChallengeRequest.Fields>("ChallengeRequest", undefined).add(TT.SelectedChallenge, (t, { text }) => t.selectedChallenge = text, { order: 1, required: true }).add(TT.ParameterKey, (t, { text }) => parameter_kv.parseKey(t.parameters, text), { order: 2, repeat: true }).add(TT.ParameterValue, (t, { value }) => parameter_kv.parseValue(t.parameters, value), { order: 2, repeat: true })

Const EVD

EVD: EvDecoder<Fields> = new EvDecoder<ChallengeResponse.Fields>("ChallengeResponse", undefined).add(TT.Status, (t, { nni }) => t.status = NNI.constrain(nni, "Status", Status.MAX, Status.MIN), { required: true }).add(TT.ChallengeStatus, (t, { text }) => t.challengeStatus = text).add(TT.RemainingTries, (t, { nni }) => t.remainingTries = nni).add(TT.RemainingTime, (t, { nni }) => t.remainingTime = nni * 1000).add(TT.IssuedCertName, (t, { vd }) => t.issuedCertName = vd.decode(Name))

Const EVD

EVD: EvDecoder<ErrorMsg> = new EvDecoder<ErrorMsg>("ErrorMsg", undefined).add(TT.ErrorCode, (t, { nni }) => t.errorCode = nni, { required: true }).add(TT.ErrorInfo, (t, { text }) => t.errorInfo = text, { required: true })

Const REQUEST_ID_LEN

REQUEST_ID_LEN: 8 = 8

Const SALT_LEN

SALT_LEN: 32 = 32

Const seenKey

seenKey: WeakMap<Record<string, Uint8Array>, string> = new WeakMap<ParameterKV, string>()

Functions

checkFields

  • checkFields(__namedParameters: { challengeStatus: undefined | string; issuedCertName: undefined | Name; remainingTime: undefined | number; remainingTries: undefined | number; status: Status }): void
  • Parameters

    • __namedParameters: { challengeStatus: undefined | string; issuedCertName: undefined | Name; remainingTime: undefined | number; remainingTries: undefined | number; status: Status }
      • challengeStatus: undefined | string
      • issuedCertName: undefined | Name
      • remainingTime: undefined | number
      • remainingTries: undefined | number
      • status: Status

    Returns void

checkRequestId

  • checkRequestId(input: Uint8Array): void

checkSalt

  • checkSalt(input: Uint8Array): void

decode

  • decode(wire: Uint8Array): Params

encode

encode

  • encode(__namedParameters: { authenticationTag: undefined | Uint8Array; ciphertext: Uint8Array; iv: undefined | Uint8Array }): Uint8Array
  • Parameters

    • __namedParameters: { authenticationTag: undefined | Uint8Array; ciphertext: Uint8Array; iv: undefined | Uint8Array }
      • authenticationTag: undefined | Uint8Array
      • ciphertext: Uint8Array
      • iv: undefined | Uint8Array

    Returns Uint8Array

exportEcdhPub

  • exportEcdhPub(key: CryptoKey): Promise<Uint8Array>

finish

generateEcdhKey

  • generateEcdhKey(): Promise<CryptoKeyPair>

importEcdhPub

  • importEcdhPub(raw: Uint8Array): Promise<CryptoKey>

makeRequestId

  • makeRequestId(): Uint8Array

makeSalt

  • makeSalt(): Uint8Array

makeSessionKey

  • makeSessionKey(ecdhPvt: CryptoKey, ecdhPub: CryptoKey, salt: Uint8Array, requestId: Uint8Array, role: SessionRole): Promise<SessionKey>

makeSignedInterestPolicy

  • makeSignedInterestPolicy(): SignedInterestPolicy

parseKey

parseValue

requestCertificate

truncateValidity

  • truncateValidity(validity: ValidityPeriod, __namedParameters: { cert: { caValidity: ValidityPeriod }; maxValidityPeriod: number }, enableNotBeforeGracePeriod?: boolean): ValidityPeriod
  • Parameters

    • validity: ValidityPeriod
    • __namedParameters: { cert: { caValidity: ValidityPeriod }; maxValidityPeriod: number }
      • cert: { caValidity: ValidityPeriod }
        • caValidity: ValidityPeriod
      • maxValidityPeriod: number
    • Default value enableNotBeforeGracePeriod: boolean = false

    Returns ValidityPeriod

Object literals

Const ECDH_PARAMS

ECDH_PARAMS: object

name

name: string = "ECDH"

namedCurve

namedCurve: string = "P-256"

Const TT

TT: object

AuthenticationTag

AuthenticationTag: number = 175

CaCertificate

CaCertificate: number = 137

CaInfo

CaInfo: number = 131

CaPrefix

CaPrefix: number = 129

CertRequest

CertRequest: number = 147

CertToRevoke

CertToRevoke: number = 177

Challenge

Challenge: number = 153

ChallengeStatus

ChallengeStatus: number = 163

EcdhPub

EcdhPub: number = 145

EncryptedPayload

EncryptedPayload: number = 159

ErrorCode

ErrorCode: number = 171

ErrorInfo

ErrorInfo: number = 173

InitializationVector

InitializationVector: number = 157

IssuedCertName

IssuedCertName: number = 169

MaxSuffixLength

MaxSuffixLength: number = 143

MaxValidityPeriod

MaxValidityPeriod: number = 139

ParameterKey

ParameterKey: number = 133

ParameterValue

ParameterValue: number = 135

ProbeRedirect

ProbeRedirect: number = 179

ProbeResponse

ProbeResponse: number = 141

RemainingTime

RemainingTime: number = 167

RemainingTries

RemainingTries: number = 165

RequestId

RequestId: number = 151

Salt

Salt: number = 149

SelectedChallenge

SelectedChallenge: number = 161

Status

Status: number = 155

Const Verb

Verb: object

CHALLENGE

CHALLENGE: Component = Component.from("CHALLENGE")

INFO

INFO: Component = Component.from("INFO")

NEW

NEW: Component = Component.from("NEW")

PROBE

PROBE: Component = Component.from("PROBE")

Legend

  • Namespace
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Type alias with type parameter
  • Interface
  • Interface with type parameter
  • Class
  • Class with type parameter
  • Enumeration

Generated using TypeDoc