aboutsummaryrefslogtreecommitdiffstats
path: root/lang/js/src/Signature.js
diff options
context:
space:
mode:
Diffstat (limited to 'lang/js/src/Signature.js')
-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);
}
/**