From 4015f5b4983c8a4590aa71776880d8bc42c7918d Mon Sep 17 00:00:00 2001 From: Maximilian Krambach Date: Tue, 10 Jul 2018 14:32:26 +0200 Subject: js: documentation -- * Fixed errors: - src/Message.js post(): Set chunksize to defined default value instead of hardcoded - src/Keys.js: added getHasSecret() to refreshKey operation. * Reviewed and updated the documentation * non-documentation changes which do not affect functionality: - src/Errors: disabled a console.warn that is only useful for debugging - helpers.js: renamed "string" to "value" in isFingerprint and isLongId to avoid confusion - src/Keyring: prepare_sync, search are both explicitly set to false by default --- lang/js/src/Signature.js | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'lang/js/src/Signature.js') diff --git a/lang/js/src/Signature.js b/lang/js/src/Signature.js index c3c511a8..191e00ab 100644 --- a/lang/js/src/Signature.js +++ b/lang/js/src/Signature.js @@ -20,17 +20,16 @@ * Author(s): * Maximilian Krambach */ +import { gpgme_error } from './Errors'; /** - * Validates a signature object and returns + * Validates an object containing a signature, as sent by the nativeMessaging + * interface * @param {Object} sigObject Object as returned by gpgme-json. The definition - * of the expected values are to be found in the constants 'expKeys', 'expSum', - * 'expNote' in this file. - * @returns {GPGME_Signature} Signature Object + * of the expected values are to be found in {@link expKeys}, {@link expSum}, + * {@link expNote}. + * @returns {GPGME_Signature|GPGME_Error} Signature Object */ - -import { gpgme_error } from './Errors'; - export function createSignature(sigObject){ if ( typeof(sigObject) !=='object' || @@ -72,18 +71,20 @@ export function createSignature(sigObject){ /** - * Representing the details of a signature. It is supposed to be read-only. The - * full details as given by gpgme-json can be accessed from the _rawSigObject. - * ) + * Representing the details of a signature. The full details as given by + * gpgme-json can be read from the _rawSigObject. + * + * Note to reviewers: This class should be read only except via + * {@link createSignature} + * @protected + * @class */ class GPGME_Signature { + constructor(sigObject){ this._rawSigObject = sigObject; } - /** - * The signatures' fingerprint - */ get fingerprint(){ return this._rawSigObject.fingerprint; } @@ -105,7 +106,7 @@ class GPGME_Signature { * @returns {Date} */ get timestamp(){ - return new Date(this._rawSigObject.timestamp* 1000); + return new Date(this._rawSigObject.timestamp * 1000); } /** -- cgit v1.2.3