UNPKG

react-native-quick-crypto

Version:

A fast implementation of Node's `crypto` module written in C/C++ JSI

57 lines (51 loc) 1.96 kB
"use strict"; // @types/node // Node.js style key pair types (lowercase) // TODO: These enums need to be defined on the native side export let KFormatType = /*#__PURE__*/function (KFormatType) { KFormatType[KFormatType["DER"] = 0] = "DER"; KFormatType[KFormatType["PEM"] = 1] = "PEM"; KFormatType[KFormatType["JWK"] = 2] = "JWK"; return KFormatType; }({}); export let KeyType = /*#__PURE__*/function (KeyType) { KeyType[KeyType["SECRET"] = 0] = "SECRET"; KeyType[KeyType["PUBLIC"] = 1] = "PUBLIC"; KeyType[KeyType["PRIVATE"] = 2] = "PRIVATE"; return KeyType; }({}); export let KeyEncoding = /*#__PURE__*/function (KeyEncoding) { KeyEncoding[KeyEncoding["PKCS1"] = 0] = "PKCS1"; KeyEncoding[KeyEncoding["PKCS8"] = 1] = "PKCS8"; KeyEncoding[KeyEncoding["SPKI"] = 2] = "SPKI"; KeyEncoding[KeyEncoding["SEC1"] = 3] = "SEC1"; return KeyEncoding; }({}); export let KeyFormat = /*#__PURE__*/function (KeyFormat) { KeyFormat[KeyFormat["RAW"] = 0] = "RAW"; KeyFormat[KeyFormat["PKCS8"] = 1] = "PKCS8"; KeyFormat[KeyFormat["SPKI"] = 2] = "SPKI"; KeyFormat[KeyFormat["JWK"] = 3] = "JWK"; return KeyFormat; }({}); export const kNamedCurveAliases = { 'P-256': 'prime256v1', 'P-384': 'secp384r1', 'P-521': 'secp521r1' }; // end TODO export let KeyVariant = /*#__PURE__*/function (KeyVariant) { KeyVariant[KeyVariant["RSA_SSA_PKCS1_v1_5"] = 0] = "RSA_SSA_PKCS1_v1_5"; KeyVariant[KeyVariant["RSA_PSS"] = 1] = "RSA_PSS"; KeyVariant[KeyVariant["RSA_OAEP"] = 2] = "RSA_OAEP"; KeyVariant[KeyVariant["DSA"] = 3] = "DSA"; KeyVariant[KeyVariant["EC"] = 4] = "EC"; KeyVariant[KeyVariant["NID"] = 5] = "NID"; KeyVariant[KeyVariant["DH"] = 6] = "DH"; return KeyVariant; }({}); // These are for shortcomings in @types/node // Here we use "*Type" instead of "*Types" like node does. // export type CipherCBCType = 'aes-128-cbc' | 'aes-192-cbc' | 'aes-256-cbc'; // from @paulmillr/noble-curves //# sourceMappingURL=types.js.map