Comparing version 5.2.0 to 5.2.1
@@ -10,2 +10,4 @@ /** | ||
import type { WebStream as GenericWebStream, NodeStream as GenericNodeStream } from '@openpgp/web-stream-tools'; | ||
/* ############## v5 KEY #################### */ | ||
@@ -175,11 +177,5 @@ // The Key and PublicKey types can be used interchangably since TS cannot detect the difference, as they have the same class properties. | ||
export function generateSessionKey(options: { encryptionKeys: MaybeArray<PublicKey>, date?: Date, encryptionUserIDs?: MaybeArray<UserID>, config?: PartialConfig }): Promise<SessionKey>; | ||
export function encryptSessionKey(options: SessionKey & { | ||
encryptionKeys?: MaybeArray<PublicKey>, passwords?: MaybeArray<string>, format?: 'armored', wildcard?: boolean, encryptionKeyIDs?: MaybeArray<KeyID>, date?: Date, encryptionUserIDs?: MaybeArray<UserID>, config?: PartialConfig | ||
}) : Promise<string>; | ||
export function encryptSessionKey(options: SessionKey & { | ||
encryptionKeys?: MaybeArray<PublicKey>, passwords?: MaybeArray<string>, format: 'binary', wildcard?: boolean, encryptionKeyIDs?: MaybeArray<KeyID>, date?: Date, encryptionUserIDs?: MaybeArray<UserID>, config?: PartialConfig | ||
}) : Promise<Uint8Array>; | ||
export function encryptSessionKey(options: SessionKey & { | ||
encryptionKeys?: MaybeArray<PublicKey>, passwords?: MaybeArray<string>, format: 'object', wildcard?: boolean, encryptionKeyIDs?: MaybeArray<KeyID>, date?: Date, encryptionUserIDs?: MaybeArray<UserID>, config?: PartialConfig | ||
}) : Promise<Message<Data>>; | ||
export function encryptSessionKey(options: EncryptSessionKeyOptions & { format?: 'armored' }): Promise<string>; | ||
export function encryptSessionKey(options: EncryptSessionKeyOptions & { format: 'binary' }): Promise<Uint8Array>; | ||
export function encryptSessionKey(options: EncryptSessionKeyOptions & { format: 'object' }): Promise<Message<Data>>; | ||
export function decryptSessionKeys<T extends MaybeStream<Data>>(options: { message: Message<T>, decryptionKeys?: MaybeArray<PrivateKey>, passwords?: MaybeArray<string>, date?: Date, config?: PartialConfig }): Promise<SessionKey[]>; | ||
@@ -276,3 +272,3 @@ | ||
*/ | ||
public getLiteralData(): MaybeStream<Uint8Array> | null; | ||
public getLiteralData(): (T extends Stream<Data> ? WebStream<Uint8Array> : Uint8Array) | null; | ||
@@ -285,3 +281,3 @@ /** Returns the key IDs of the keys that signed the message | ||
*/ | ||
public getText(): MaybeStream<string> | null; | ||
public getText(): (T extends Stream<Data> ? WebStream<string> : string) | null; | ||
@@ -555,14 +551,6 @@ public getFilename(): string | null; | ||
type Data = Uint8Array | string; | ||
interface BaseStream<T extends Data> extends AsyncIterable<T> { } | ||
interface WebStream<T extends Data> extends BaseStream<T> { // copied+simplified version of ReadableStream from lib.dom.d.ts | ||
readonly locked: boolean; getReader: Function; pipeThrough: Function; pipeTo: Function; tee: Function; | ||
cancel(reason?: any): Promise<void>; | ||
} | ||
interface NodeStream<T extends Data> extends BaseStream<T> { // copied+simplified version of ReadableStream from @types/node/index.d.ts | ||
readable: boolean; pipe: Function; unpipe: Function; wrap: Function; | ||
read(size?: number): string | Uint8Array; setEncoding(encoding: string): this; pause(): this; resume(): this; | ||
isPaused(): boolean; unshift(chunk: string | Uint8Array): void; | ||
} | ||
type Stream<T extends Data> = WebStream<T> | NodeStream<T>; | ||
type MaybeStream<T extends Data> = T | Stream<T>; | ||
export interface WebStream<T extends Data> extends GenericWebStream<T> {} | ||
export interface NodeStream<T extends Data> extends GenericNodeStream<T> {} | ||
export type Stream<T extends Data> = WebStream<T> | NodeStream<T>; | ||
export type MaybeStream<T extends Data> = T | Stream<T>; | ||
@@ -635,3 +623,3 @@ /* ############## v5 GENERAL #################### */ | ||
message: CleartextMessage | Message<MaybeStream<Data>>; | ||
signingKeys?: MaybeArray<PrivateKey>; | ||
signingKeys: MaybeArray<PrivateKey>; | ||
format?: 'armored' | 'binary' | 'object'; | ||
@@ -661,2 +649,12 @@ detached?: boolean; | ||
interface EncryptSessionKeyOptions extends SessionKey { | ||
encryptionKeys?: MaybeArray<PublicKey>, | ||
passwords?: MaybeArray<string>, | ||
format?: 'armored' | 'binary' | 'object', | ||
date?: Date, | ||
wildcard?: boolean, | ||
encryptionKeyIDs?: MaybeArray<KeyID>, | ||
encryptionUserIDs?: MaybeArray<UserID>, | ||
config?: PartialConfig | ||
} | ||
@@ -663,0 +661,0 @@ interface SerializedKeyPair<T extends string|Uint8Array> { |
{ | ||
"name": "openpgp", | ||
"description": "OpenPGP.js is a Javascript implementation of the OpenPGP protocol. This is defined in RFC 4880.", | ||
"version": "5.2.0", | ||
"version": "5.2.1", | ||
"license": "LGPL-3.0+", | ||
@@ -62,3 +62,3 @@ "homepage": "https://openpgpjs.org/", | ||
"@openpgp/tweetnacl": "^1.0.3", | ||
"@openpgp/web-stream-tools": "0.0.9", | ||
"@openpgp/web-stream-tools": "^0.0.10", | ||
"@rollup/plugin-commonjs": "^11.1.0", | ||
@@ -91,3 +91,4 @@ "@rollup/plugin-node-resolve": "^7.1.3", | ||
"sinon": "^4.3.0", | ||
"typescript": "^4.1.2" | ||
"typescript": "^4.1.2", | ||
"web-streams-polyfill": "^3.2.0" | ||
}, | ||
@@ -94,0 +95,0 @@ "dependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21897846
36
207592