Class: PolarisSDK
Implements
Constructors
new PolarisSDK()
new PolarisSDK(
keyHandler
):PolarisSDK
Parameters
keyHandler
Returns
Methods
decrypt()
decrypt(
message
):Promise
<Buffer
>
Decrypt data
Parameters
message
Buffer
Encrypted message
Returns
Promise
<Buffer
>
The decrypted data
Implementation of
encrypt()
encrypt(
data
,publicKey
):Promise
<Buffer
>
Encrypt data
Parameters
data
Buffer
Data to encrypt
publicKey
string
Public key used to wrap the encryption key with
Returns
Promise
<Buffer
>
The encrypted message as buffer
Implementation of
getPublicKey()
getPublicKey():
Promise
<string
>
Get the public key of the confgured key service
Returns
Promise
<string
>
The public key in PEM format
Implementation of
PolarisSDKInterface
.getPublicKey
unwrapKey()
unwrapKey(
wrappedKey
):Promise
<Buffer
>
Unwrap a symmetric encryption key or IV with the configured private key
Parameters
wrappedKey
Buffer
Returns
Promise
<Buffer
>
The unwrapped key as Buffer
Implementation of
wrapKey()
wrapKey(
key
,publicKey
):Promise
<Buffer
>
Wrap a symmetric encryption key or IV with a given public key.
PCKS1 padding is used with a sha256 hash.
Parameters
key
Buffer
The key to wrap as Buffer
publicKey
string
The public key to wrap the key with
Returns
Promise
<Buffer
>
The wrapped key as Buffer