CryptoServiceParameters
Class: CryptoServiceParameters
Defined in: packages/core/src/services/icryptoservice.ts:4
Parameters for the CryptoService including key lifecycle, rotation, and algorithm settings
Extends
Constructors
Constructor
new CryptoServiceParameters():
CryptoServiceParameters
Returns
CryptoServiceParameters
Inherited from
Properties
asymetricOptions?
optionalasymetricOptions?:object
Defined in: packages/core/src/services/icryptoservice.ts:52
Options for asymetric generation
modulusLength?
optionalmodulusLength?:number
Default
2048
namedCurve?
optionalnamedCurve?:string
Only if asymetricType "ec"
privateKeyEncoding?
optionalprivateKeyEncoding?:object
privateKeyEncoding.cipher?
optionalcipher?:string
privateKeyEncoding.format?
optionalformat?:"pem"
privateKeyEncoding.passphrase?
optionalpassphrase?:string
Passphrase used to encrypt the private key
Can be encrypted with webda config encrypt
Secret
privateKeyEncoding.type?
optionaltype?:"pkcs1"|"pkcs8"|"sec1"
https://nodejs.org/docs/latest-v14.x/api/crypto.html#crypto_keyobject_export_options
Default
pkcs8
publicKeyEncoding?
optionalpublicKeyEncoding?:object
publicKeyEncoding.format?
optionalformat?:"pem"
publicKeyEncoding.type?
optionaltype?:"spki"|"pkcs1"
Default
spki
asymetricType
asymetricType:
"rsa"|"dsa"|"ec"|"ed25519"|"ed448"|"x25519"|"x448"|"dh"
Defined in: packages/core/src/services/icryptoservice.ts:48
Type of asymetric key
https://nodejs.org/api/crypto.html#cryptogeneratekeypairsynctype-options https://nodejs.org/docs/latest-v14.x/api/crypto.html#crypto_crypto_generatekeypairsync_type_options
autoCreate?
optionalautoCreate?:boolean
Defined in: packages/core/src/services/icryptoservice.ts:22
Create first set of key if does not exist
autoRotate?
optionalautoRotate?:number
Defined in: packages/core/src/services/icryptoservice.ts:18
Try to rotate keys when they expire in days
jwt?
optionaljwt?:JWTOptions
Defined in: packages/core/src/services/icryptoservice.ts:98
Default JWT options
secretOrPublicKey can be encrypted with webda config encrypt
keyActiveLifespan
keyActiveLifespan:
number
Defined in: packages/core/src/services/icryptoservice.ts:10
Number of hours a key should be used for encryption
if auto-rotate is not set this
keyLifespan
keyLifespan:
number
Defined in: packages/core/src/services/icryptoservice.ts:14
Number of hours allowed to decrypt data encrypted with this key
keysFile?
optionalkeysFile?:string
Defined in: packages/core/src/services/icryptoservice.ts:34
JSON file holding the keys, typically a mounted Kubernetes secret, instead of the registry
Same shape as the registry entry: { "current": "<id>", "key_<id>": { publicKey, privateKey, symetric } }.
A relative path is resolved against the application path. Generate one with webda crypto generate-keys.
When set, the registry is never read nor written: autoCreate and autoRotate are ignored and
CryptoService.rotate fails. Rotate by adding a key_<id> to the file and switching current, keep
the previous keys as long as data encrypted with them must stay readable. The file is reloaded when it
changes, no restart needed.
symetricCipher?
optionalsymetricCipher?:string
Defined in: packages/core/src/services/icryptoservice.ts:92
Default
"aes-256-ctr"
symetricKeyLength?
optionalsymetricKeyLength?:number
Defined in: packages/core/src/services/icryptoservice.ts:88
Default
256
type
type:
string
Defined in: packages/core/src/services/serviceparameters.ts:10
Type of the service
Inherited from
url?
optionalurl?:string
Defined in: packages/core/src/services/icryptoservice.ts:40
To expose JWKS
See
https://datatracker.ietf.org/doc/html/rfc7517
Methods
load()
load(
params?):this
Defined in: packages/core/src/services/icryptoservice.ts:105
Load parameters with defaults for key lengths, ciphers, and JWT options
Parameters
params?
any = {}
the service parameters
Returns
this
this for chaining
Overrides
update()
update(
params?,delta):this
Defined in: packages/core/src/application/parameters.ts:33
Update parameters and call watchers if a parameter was changed
Parameters
params?
any = {}
the service parameters
delta
any
the delta
Returns
this
this for chaining
Inherited from
with()
with(
callback):this
Defined in: packages/core/src/application/parameters.ts:63
Watch for changes on the parameters and call watchers when a parameter is changed
Parameters
callback
(params) => void
the callback function
Returns
this
this for chaining