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:40
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
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:36
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:78
Default JWT options
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
symetricCipher?
optionalsymetricCipher?:string
Defined in: packages/core/src/services/icryptoservice.ts:74
Default
"aes-256-ctr"
symetricKeyLength?
optionalsymetricKeyLength?:number
Defined in: packages/core/src/services/icryptoservice.ts:70
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:28
To expose JWKS
See
https://datatracker.ietf.org/doc/html/rfc7517
Methods
load()
load(
params?):this
Defined in: packages/core/src/services/icryptoservice.ts:85
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/services/serviceparameters.ts:35
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/services/serviceparameters.ts:65
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