Variables
Const AES_ALGORITHM
AES_ALGORITHM: "AES-GCM" = "AES-GCM"
Const AES_IV_SIZE
AES_IV_SIZE: 12 = 12
Const CryptoFailure
CryptoFailure: unique symbol = Symbol.for('CryptoFailure')
Const DEFAULT_ITERATIONS
DEFAULT_ITERATIONS: 2000 = 2000
Const ENCRYPT_AND_DECRYPT
ENCRYPT_AND_DECRYPT: KeyUsage[] = ['encrypt', 'decrypt']
Const EXTRACTABLE
EXTRACTABLE: false = false
Const HASH
HASH: "SHA-256" = "SHA-256"
Const MODULUS_LENGTH
MODULUS_LENGTH: 2048 = 2048
Const PUBLIC_EXPONENT
PUBLIC_EXPONENT: Uint8Array = new Uint8Array([0x01, 0x00, 0x01])
Const SIGN_AND_VERIFY
SIGN_AND_VERIFY: KeyUsage[] = ['sign', 'verify']
Const decrypt
decrypt: (Anonymous function) = createCryptoEffect('decrypt')
Const deriveBits
deriveBits: (Anonymous function) = createCryptoEffect('deriveBits')
Const deriveKey
deriveKey: (Anonymous function) = createCryptoEffect('deriveKey')
Const digest
digest: (Anonymous function) = createCryptoEffect('digest')
Const encrypt
encrypt: (Anonymous function) = createCryptoEffect('encrypt')
Const exportKey
export
Key: { (format: "jwk", key: CryptoKey): CryptoEffects<unknown, JsonWebKey>; (format: "raw" | "pkcs8" | "spki", key: CryptoKey): CryptoEffects<unknown, ArrayBuffer>; (format: string, key: CryptoKey): CryptoEffects<unknown, ArrayBuffer | JsonWebKey> } = createCryptoEffect('exportKey') as {(format: 'jwk', key: CryptoKey): CryptoEffects<unknown, JsonWebKey>(format: 'raw' | 'pkcs8' | 'spki', key: CryptoKey): CryptoEffects<unknown, ArrayBuffer>(format: string, key: CryptoKey): CryptoEffects<unknown, ArrayBuffer | JsonWebKey>}
Type declaration
-
- (format: "jwk", key: CryptoKey): CryptoEffects<unknown, JsonWebKey>
- (format: "raw" | "pkcs8" | "spki", key: CryptoKey): CryptoEffects<unknown, ArrayBuffer>
- (format: string, key: CryptoKey): CryptoEffects<unknown, ArrayBuffer | JsonWebKey>
-
Parameters
-
format: "jwk"
-
key: CryptoKey
Returns CryptoEffects<unknown, JsonWebKey>
-
Parameters
-
format: "raw" | "pkcs8" | "spki"
-
key: CryptoKey
Returns CryptoEffects<unknown, ArrayBuffer>
-
Parameters
-
format: string
-
key: CryptoKey
Returns CryptoEffects<unknown, ArrayBuffer | JsonWebKey>
Const generateKey
generate
Key: { (algorithm: string, extractable: boolean, keyUsages: string[]): CryptoEffects<unknown, CryptoKey | CryptoKeyPair>; (algorithm: RsaHashedKeyGenParams | EcKeyGenParams | DhKeyGenParams, extractable: boolean, keyUsages: string[]): CryptoEffects<unknown, CryptoKeyPair>; (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: string[]): CryptoEffects<unknown, CryptoKey> } = createCryptoEffect('generateKey') as {(algorithm: string, extractable: boolean, keyUsages: string[]): CryptoEffects<unknown,CryptoKey | CryptoKeyPair>(algorithm: RsaHashedKeyGenParams | EcKeyGenParams | DhKeyGenParams,extractable: boolean,keyUsages: string[],): CryptoEffects<unknown, CryptoKeyPair>(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params,extractable: boolean,keyUsages: string[],): CryptoEffects<unknown, CryptoKey>}
Type declaration
-
- (algorithm: string, extractable: boolean, keyUsages: string[]): CryptoEffects<unknown, CryptoKey | CryptoKeyPair>
- (algorithm: RsaHashedKeyGenParams | EcKeyGenParams | DhKeyGenParams, extractable: boolean, keyUsages: string[]): CryptoEffects<unknown, CryptoKeyPair>
- (algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: string[]): CryptoEffects<unknown, CryptoKey>
-
Parameters
-
algorithm: string
-
extractable: boolean
-
keyUsages: string[]
-
Parameters
-
algorithm: RsaHashedKeyGenParams | EcKeyGenParams | DhKeyGenParams
-
extractable: boolean
-
keyUsages: string[]
-
Parameters
-
algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params
-
extractable: boolean
-
keyUsages: string[]
Returns CryptoEffects<unknown, CryptoKey>
Const importKey
import
Key: { (format: "raw" | "pkcs8" | "spki", keyData: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm, extractable: boolean, keyUsages: string[]): CryptoEffects<unknown, CryptoKey>; (format: "jwk", keyData: JsonWebKey, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm, extractable: boolean, keyUsages: string[]): CryptoEffects<unknown, CryptoKey>; (format: string, keyData: JsonWebKey | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm, extractable: boolean, keyUsages: string[]): CryptoEffects<unknown, CryptoKey> } = createCryptoEffect('importKey') as {(format: 'raw' | 'pkcs8' | 'spki',keyData:| Int8Array| Int16Array| Int32Array| Uint8Array| Uint16Array| Uint32Array| Uint8ClampedArray| Float32Array| Float64Array| DataView| ArrayBuffer,algorithm:| string| RsaHashedImportParams| EcKeyImportParams| HmacImportParams| DhImportKeyParams| AesKeyAlgorithm,extractable: boolean,keyUsages: string[],): CryptoEffects<unknown, CryptoKey>(format: 'jwk',keyData: JsonWebKey,algorithm:| string| RsaHashedImportParams| EcKeyImportParams| HmacImportParams| DhImportKeyParams| AesKeyAlgorithm,extractable: boolean,keyUsages: string[],): CryptoEffects<unknown, CryptoKey>(format: string,keyData:| JsonWebKey| Int8Array| Int16Array| Int32Array| Uint8Array| Uint16Array| Uint32Array| Uint8ClampedArray| Float32Array| Float64Array| DataView| ArrayBuffer,algorithm:| string| RsaHashedImportParams| EcKeyImportParams| HmacImportParams| DhImportKeyParams| AesKeyAlgorithm,extractable: boolean,keyUsages: string[],): CryptoEffects<unknown, CryptoKey>}
Type declaration
-
- (format: "raw" | "pkcs8" | "spki", keyData: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm, extractable: boolean, keyUsages: string[]): CryptoEffects<unknown, CryptoKey>
- (format: "jwk", keyData: JsonWebKey, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm, extractable: boolean, keyUsages: string[]): CryptoEffects<unknown, CryptoKey>
- (format: string, keyData: JsonWebKey | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm, extractable: boolean, keyUsages: string[]): CryptoEffects<unknown, CryptoKey>
-
Parameters
-
format: "raw" | "pkcs8" | "spki"
-
keyData: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer
-
algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm
-
extractable: boolean
-
keyUsages: string[]
Returns CryptoEffects<unknown, CryptoKey>
-
Parameters
-
format: "jwk"
-
keyData: JsonWebKey
-
algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm
-
extractable: boolean
-
keyUsages: string[]
Returns CryptoEffects<unknown, CryptoKey>
-
Parameters
-
format: string
-
keyData: JsonWebKey | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer
-
algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm
-
extractable: boolean
-
keyUsages: string[]
Returns CryptoEffects<unknown, CryptoKey>
Const sign
sign: (Anonymous function) = createCryptoEffect('sign')
Const unwrapKey
unwrapKey: (Anonymous function) = createCryptoEffect('unwrapKey')
Const verify
verify: (Anonymous function) = createCryptoEffect('verify')
Const wrapKey
wrapKey: (Anonymous function) = createCryptoEffect('wrapKey')
@typed/crypto
A handful of cryptographic use-cases built upon
@typed/effects
.