From 7d02154dc959c246b2b01d975648ee94f19031f5 Mon Sep 17 00:00:00 2001 From: Sanjana Rajan Date: Mon, 6 Mar 2017 20:04:10 -0800 Subject: [PATCH] small fixes --- src/cleartext.js | 2 +- src/encoding/armor.js | 1 + src/index.js | 7 +++++++ src/signature.js | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/cleartext.js b/src/cleartext.js index 3b705926..7c17ddf6 100644 --- a/src/cleartext.js +++ b/src/cleartext.js @@ -48,7 +48,7 @@ export function CleartextMessage(text, signature) { if (signature && !(signature instanceof sigModule.Signature)) { throw new Error('Invalid signature input'); } - this.signature = signature || new sigModule.Signature([]); + this.signature = signature || new sigModule.Signature(new packet.List()); } /** diff --git a/src/encoding/armor.js b/src/encoding/armor.js index 099fd074..68607308 100644 --- a/src/encoding/armor.js +++ b/src/encoding/armor.js @@ -38,6 +38,7 @@ import config from '../config'; * 3 = PGP MESSAGE * 4 = PUBLIC KEY BLOCK * 5 = PRIVATE KEY BLOCK + * 6 = SIGNATURE */ function getType(text) { var reHeader = /^-----BEGIN PGP (MESSAGE, PART \d+\/\d+|MESSAGE, PART \d+|SIGNED MESSAGE|MESSAGE|PUBLIC KEY BLOCK|PRIVATE KEY BLOCK|SIGNATURE)-----$\n/m; diff --git a/src/index.js b/src/index.js index 32832af5..7472326b 100644 --- a/src/index.js +++ b/src/index.js @@ -26,6 +26,13 @@ export * from './openpgp'; import * as keyMod from './key'; export const key = keyMod; +/** + * @see module:signature + * @name module:openpgp.signature + */ +import * as signatureMod from './signature'; +export const signature = signatureMod; + /** * @see module:message * @name module:openpgp.message diff --git a/src/signature.js b/src/signature.js index 342d7e68..f0963025 100644 --- a/src/signature.js +++ b/src/signature.js @@ -32,7 +32,7 @@ import armor from './encoding/armor.js'; /** * @class - * @classdesc Class that represents an OpenPGP message. + * @classdesc Class that represents an OpenPGP signature. * Can be an encrypted message, signed message, compressed message or literal message * @param {module:packet/packetlist} packetlist The packets that form this message * See {@link http://tools.ietf.org/html/rfc4880#section-11.3}