aboutsummaryrefslogtreecommitdiffstats
path: root/lang/js/src/Signature.js
diff options
context:
space:
mode:
authorMaximilian Krambach <[email protected]>2018-07-10 12:32:26 +0000
committerMaximilian Krambach <[email protected]>2018-07-10 12:32:26 +0000
commit4015f5b4983c8a4590aa71776880d8bc42c7918d (patch)
tree2a4b6bd7a5e791a46cfca9143559ff8e8b20234e /lang/js/src/Signature.js
parentjs: fix verify result reporting (diff)
downloadgpgme-4015f5b4983c8a4590aa71776880d8bc42c7918d.tar.gz
gpgme-4015f5b4983c8a4590aa71776880d8bc42c7918d.zip
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
Diffstat (limited to '')
-rw-r--r--lang/js/src/Signature.js29
1 files changed, 15 insertions, 14 deletions
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 <[email protected]>
*/
+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);
}
/**