mirror of
https://github.com/openpgpjs/openpgpjs.git
synced 2025-06-07 22:56:40 +00:00
Use positive cert for self-signatures (#1769)
To uniform behaviour with other openpgp libs.
This commit is contained in:
parent
4026e24585
commit
7af16be62b
@ -257,7 +257,7 @@ async function wrapKeyObject(secretKeyPacket, secretSubkeyPackets, options, conf
|
|||||||
key: secretKeyPacket
|
key: secretKeyPacket
|
||||||
};
|
};
|
||||||
const signatureProperties = secretKeyPacket.version !== 6 ? getKeySignatureProperties() : {};
|
const signatureProperties = secretKeyPacket.version !== 6 ? getKeySignatureProperties() : {};
|
||||||
signatureProperties.signatureType = enums.signature.certGeneric;
|
signatureProperties.signatureType = enums.signature.certPositive;
|
||||||
if (index === 0) {
|
if (index === 0) {
|
||||||
signatureProperties.isPrimaryUserID = true;
|
signatureProperties.isPrimaryUserID = true;
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,8 @@ export async function generateSecretKey(options, config) {
|
|||||||
* Returns the valid and non-expired signature that has the latest creation date, while ignoring signatures created in the future.
|
* Returns the valid and non-expired signature that has the latest creation date, while ignoring signatures created in the future.
|
||||||
* @param {Array<SignaturePacket>} signatures - List of signatures
|
* @param {Array<SignaturePacket>} signatures - List of signatures
|
||||||
* @param {PublicKeyPacket|PublicSubkeyPacket} publicKey - Public key packet to verify the signature
|
* @param {PublicKeyPacket|PublicSubkeyPacket} publicKey - Public key packet to verify the signature
|
||||||
|
* @param {module:enums.signature} signatureType - Signature type to determine how to hash the data (NB: for userID signatures,
|
||||||
|
* `enums.signatures.certGeneric` should be given regardless of the actual trust level)
|
||||||
* @param {Date} date - Use the given date instead of the current time
|
* @param {Date} date - Use the given date instead of the current time
|
||||||
* @param {Object} config - full configuration
|
* @param {Object} config - full configuration
|
||||||
* @returns {Promise<SignaturePacket>} The latest valid signature.
|
* @returns {Promise<SignaturePacket>} The latest valid signature.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user