1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-28 16:20:57 -05:00

chore(ext/node): copy internal/crypto/types.ts from std (#18156)

This commit is contained in:
Yoshiya Hinosawa 2023-03-14 00:18:07 +09:00 committed by GitHub
parent 58d8b2e98d
commit cd8a8993f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,46 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
// Copyright Joyent, Inc. and Node.js contributors. All rights reserved. MIT license.
import { Buffer } from "../../buffer.ts";
export type HASH_DATA = string | ArrayBufferView | Buffer;
export type BinaryToTextEncoding = "base64" | "base64url" | "hex" | "binary";
export type CharacterEncoding = "utf8" | "utf-8" | "utf16le" | "latin1";
export type LegacyCharacterEncoding = "ascii" | "binary" | "ucs2" | "ucs-2";
export type Encoding =
| BinaryToTextEncoding
| CharacterEncoding
| LegacyCharacterEncoding;
export type ECDHKeyFormat = "compressed" | "uncompressed" | "hybrid";
export type BinaryLike = string | ArrayBufferView;
export type KeyFormat = "pem" | "der";
export type KeyType =
| "rsa"
| "rsa-pss"
| "dsa"
| "ec"
| "ed25519"
| "ed448"
| "x25519"
| "x448";
export interface PrivateKeyInput {
key: string | Buffer;
format?: KeyFormat | undefined;
type?: "pkcs1" | "pkcs8" | "sec1" | undefined;
passphrase?: string | Buffer | undefined;
}
export interface PublicKeyInput {
key: string | Buffer;
format?: KeyFormat | undefined;
type?: "pkcs1" | "spki" | undefined;
}