Address comments
This commit is contained in:
parent
071fc35f38
commit
454ca1d879
|
@ -24,7 +24,6 @@
|
||||||
* @module cleartext
|
* @module cleartext
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import util from './util.js';
|
|
||||||
import config from './config';
|
import config from './config';
|
||||||
import armor from './encoding/armor';
|
import armor from './encoding/armor';
|
||||||
import enums from './enums';
|
import enums from './enums';
|
||||||
|
|
|
@ -677,7 +677,6 @@ Key.prototype.signAllUsers = async function(privateKeys) {
|
||||||
* - if no arguments are given, verifies the self certificates;
|
* - if no arguments are given, verifies the self certificates;
|
||||||
* - otherwise, verifies all certificates signed with given keys.
|
* - otherwise, verifies all certificates signed with given keys.
|
||||||
* @param {Array<module:key~Key>} keys array of keys to verify certificate signatures
|
* @param {Array<module:key~Key>} keys array of keys to verify certificate signatures
|
||||||
* @param {Date} date (optional) use the given date for verification instead of the current time
|
|
||||||
* @return {Array<({keyid: module:type/keyid, valid: Boolean})>} list of signer's keyid and validity of signature
|
* @return {Array<({keyid: module:type/keyid, valid: Boolean})>} list of signer's keyid and validity of signature
|
||||||
*/
|
*/
|
||||||
Key.prototype.verifyPrimaryUser = async function(keys) {
|
Key.prototype.verifyPrimaryUser = async function(keys) {
|
||||||
|
@ -957,7 +956,7 @@ SubKey.prototype.toPacketlist = function() {
|
||||||
* @return {Boolean}
|
* @return {Boolean}
|
||||||
*/
|
*/
|
||||||
SubKey.prototype.isValidEncryptionKey = async function(primaryKey, date=new Date()) {
|
SubKey.prototype.isValidEncryptionKey = async function(primaryKey, date=new Date()) {
|
||||||
if (await this.verify(primaryKey) !== enums.keyStatus.valid) {
|
if (await this.verify(primaryKey, date) !== enums.keyStatus.valid) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
for (let i = 0; i < this.bindingSignatures.length; i++) {
|
for (let i = 0; i < this.bindingSignatures.length; i++) {
|
||||||
|
@ -975,7 +974,7 @@ SubKey.prototype.isValidEncryptionKey = async function(primaryKey, date=new Date
|
||||||
* @return {Boolean}
|
* @return {Boolean}
|
||||||
*/
|
*/
|
||||||
SubKey.prototype.isValidSigningKey = async function(primaryKey, date=new Date()) {
|
SubKey.prototype.isValidSigningKey = async function(primaryKey, date=new Date()) {
|
||||||
if (await this.verify(primaryKey) !== enums.keyStatus.valid) {
|
if (await this.verify(primaryKey, date) !== enums.keyStatus.valid) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
for (let i = 0; i < this.bindingSignatures.length; i++) {
|
for (let i = 0; i < this.bindingSignatures.length; i++) {
|
||||||
|
@ -1290,7 +1289,7 @@ async function wrapKeyObject(secretKeyPacket, secretSubkeyPacket, options) {
|
||||||
const dataToSign = {};
|
const dataToSign = {};
|
||||||
dataToSign.userid = userIdPacket;
|
dataToSign.userid = userIdPacket;
|
||||||
dataToSign.key = secretKeyPacket;
|
dataToSign.key = secretKeyPacket;
|
||||||
const signaturePacket = new packet.Signature(new Date(1000));
|
const signaturePacket = new packet.Signature();
|
||||||
signaturePacket.signatureType = enums.signature.cert_generic;
|
signaturePacket.signatureType = enums.signature.cert_generic;
|
||||||
signaturePacket.publicKeyAlgorithm = options.keyType;
|
signaturePacket.publicKeyAlgorithm = options.keyType;
|
||||||
signaturePacket.hashAlgorithm = getPreferredHashAlgo(secretKeyPacket);
|
signaturePacket.hashAlgorithm = getPreferredHashAlgo(secretKeyPacket);
|
||||||
|
|
|
@ -452,8 +452,6 @@ Message.prototype.compress = function(compression) {
|
||||||
* @return {module:signature~Signature} new detached signature of message content
|
* @return {module:signature~Signature} new detached signature of message content
|
||||||
*/
|
*/
|
||||||
Message.prototype.signDetached = async function(privateKeys=[], signature=null, date=new Date()) {
|
Message.prototype.signDetached = async function(privateKeys=[], signature=null, date=new Date()) {
|
||||||
const packetlist = new packet.List();
|
|
||||||
|
|
||||||
const literalDataPacket = this.packets.findPacket(enums.packet.literal);
|
const literalDataPacket = this.packets.findPacket(enums.packet.literal);
|
||||||
if (!literalDataPacket) {
|
if (!literalDataPacket) {
|
||||||
throw new Error('No literal data packet to sign.');
|
throw new Error('No literal data packet to sign.');
|
||||||
|
|
Loading…
Reference in New Issue
Block a user