CryptoConfig.nskey constructor

CryptoConfig.nskey({
  1. required NskeyKeyRing keyRing,
  2. List<String> sealsToKeyAlgorithms = SecretSharingAlgos.keyAlgos,
  3. CkRotationPolicy ckRotationPolicy = rotateCkAfterOneYear,
  4. Duration supersededCkGrace = defaultSupersededCkGrace,
  5. NskeyRotationPolicy nskeyRotationPolicy = rotateNskeyAfterOneYear,
})

The nskey data path: application data under at/symmetric/AES/GCM, content keys conveyed by at/nskey, and the CK manager that mints one the first time a destination is written to.

The SDK assembles the set because the parts are not independent — the manager and both providers must share one ContentKeyCache, or a conveyance caches a CK the data provider then cannot find. A fresh set comes back per call, and each atSign needs its own, because that cache is per-atSign state.

keyRing supplies the namespace key material. sealsToKeyAlgorithms is which of a destination's advertised KEM keys this client will seal to — AtClientPreference.sealsToKeyAlgorithms — defaulted to everything this build can seal under, which refuses nobody.

Implementation

factory CryptoConfig.nskey(
        {required NskeyKeyRing keyRing,
        List<String> sealsToKeyAlgorithms = SecretSharingAlgos.keyAlgos,
        CkRotationPolicy ckRotationPolicy = rotateCkAfterOneYear,
        Duration supersededCkGrace = defaultSupersededCkGrace,
        NskeyRotationPolicy nskeyRotationPolicy = rotateNskeyAfterOneYear}) =>
    _nskeySet(keyRing, symmetricAesGcmCryptoProviderId, sealsToKeyAlgorithms,
        ckRotationPolicy, supersededCkGrace, nskeyRotationPolicy);