mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-30 11:14:27 +08:00
Vendored
+42
-4
@@ -1,4 +1,4 @@
|
||||
// Type definitions for openpgpjs
|
||||
// Type definitions for openpgpjs
|
||||
// Project: http://openpgpjs.org/
|
||||
// Definitions by: Guillaume Lacasa <https://blog.lacasa.fr>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
@@ -364,6 +364,14 @@ declare module openpgp.enums {
|
||||
aes256,
|
||||
twofish
|
||||
}
|
||||
|
||||
enum keyStatus {
|
||||
invalid,
|
||||
expired,
|
||||
revoked,
|
||||
valid,
|
||||
no_self_cert
|
||||
}
|
||||
}
|
||||
|
||||
declare module openpgp.key {
|
||||
@@ -376,8 +384,19 @@ declare module openpgp.key {
|
||||
/** Class that represents an OpenPGP key. Must contain a primary key. Can contain additional subkeys, signatures, user ids, user attributes.
|
||||
*/
|
||||
interface Key {
|
||||
armor(): String,
|
||||
decrypt(passphrase: String): Boolean,
|
||||
armor(): string,
|
||||
decrypt(passphrase: string): boolean;
|
||||
getExpirationTime(): Date;
|
||||
getKeyIds(): Array<Keyid>;
|
||||
getPreferredHashAlgorithm(): string;
|
||||
getPrimaryUser(): any;
|
||||
getUserIds(): Array<string>;
|
||||
isPrivate(): boolean;
|
||||
isPublic(): boolean;
|
||||
primaryKey: packet.PublicKey;
|
||||
toPublic(): Key;
|
||||
update(key: Key): void;
|
||||
verifyPrimaryKey(): enums.keyStatus;
|
||||
}
|
||||
|
||||
/** Generates a new OpenPGP key. Currently only supports RSA keys. Primary and subkey will be of same type.
|
||||
@@ -462,6 +481,25 @@ declare module openpgp.message {
|
||||
|
||||
declare module openpgp.packet {
|
||||
|
||||
interface PublicKey {
|
||||
algorithm: enums.publicKey;
|
||||
created: Date;
|
||||
fingerprint: string;
|
||||
|
||||
getBitSize(): number;
|
||||
getFingerprint(): string;
|
||||
getKeyId(): string;
|
||||
read(input: string): any;
|
||||
write(): any;
|
||||
}
|
||||
|
||||
interface SecretKey extends PublicKey {
|
||||
read(bytes:string): void;
|
||||
write(): string;
|
||||
clearPrivateMPIs(str_passphrase: string): boolean;
|
||||
encrypt(passphrase:string): void;
|
||||
}
|
||||
|
||||
/** Allocate a new packet from structured packet clone
|
||||
@param packetClone packet clone
|
||||
*/
|
||||
@@ -549,4 +587,4 @@ declare module openpgp.util {
|
||||
function Uint8Array2str(bin: Uint8Array): String;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user