forked from denoland/deno
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ext/node): copy internal/crypto/types.ts from std (denoland#18156)
- Loading branch information
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |