react-native-quick-crypto
Version:
A fast implementation of Node's `crypto` module written in C/C++ JSI
55 lines (54 loc) • 2.25 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.kNamedCurveAliases = exports.KeyVariant = exports.KeyType = exports.KeyFormat = exports.KeyEncoding = exports.KFormatType = void 0;
// @types/node
// Node.js style key pair types (lowercase)
// TODO: These enums need to be defined on the native side
let KFormatType = exports.KFormatType = /*#__PURE__*/function (KFormatType) {
KFormatType[KFormatType["DER"] = 0] = "DER";
KFormatType[KFormatType["PEM"] = 1] = "PEM";
KFormatType[KFormatType["JWK"] = 2] = "JWK";
return KFormatType;
}({});
let KeyType = exports.KeyType = /*#__PURE__*/function (KeyType) {
KeyType[KeyType["SECRET"] = 0] = "SECRET";
KeyType[KeyType["PUBLIC"] = 1] = "PUBLIC";
KeyType[KeyType["PRIVATE"] = 2] = "PRIVATE";
return KeyType;
}({});
let KeyEncoding = exports.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;
}({});
let KeyFormat = exports.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;
}({});
const kNamedCurveAliases = exports.kNamedCurveAliases = {
'P-256': 'prime256v1',
'P-384': 'secp384r1',
'P-521': 'secp521r1'
};
// end TODO
let KeyVariant = exports.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