UNPKG
@tabcat/aes-gcm-crypter
Version:
latest (1.0.1)
1.0.1
1.0.0
encrypt and decrypt aes-gcm ciphers
github.com/tabcat/aes-gcm-crypter
tabcat/aes-gcm-crypter
@tabcat/aes-gcm-crypter
/
src
/
util.js
11 lines
(8 loc)
•
247 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
'use strict'
exports
.
validKey
=
(
cryptoKey
) =>
cryptoKey && cryptoKey.
type
===
'secret'
&& cryptoKey.
algorithm
&& cryptoKey.
algorithm
.
name
===
'AES-GCM'
&& cryptoKey.
usages
.
includes
(
'encrypt'
) && cryptoKey.
usages
.
includes
(
'decrypt'
)