Add API to add contexts to detached signatures.
Using the notation data packets of signatures, we add a way to set a context to detached signatures. We also add a way to enforce that signatures have the right context during verification.
This commit is contained in:
parent
3152e50f92
commit
1ec90e34ea
10 changed files with 614 additions and 19 deletions
|
|
@ -329,6 +329,27 @@ func (keyRing *KeyRing) VerifyDetachedStream(
|
|||
message,
|
||||
signature.GetBinary(),
|
||||
verifyTime,
|
||||
nil,
|
||||
)
|
||||
return err
|
||||
}
|
||||
|
||||
// VerifyDetachedStreamWithContext verifies a message reader with a detached PGPSignature
|
||||
// and returns a SignatureVerificationError if fails.
|
||||
// If a context is provided, it verifies that the signature is valid in the given context, using
|
||||
// the signature notations.
|
||||
func (keyRing *KeyRing) VerifyDetachedStreamWithContext(
|
||||
message Reader,
|
||||
signature *PGPSignature,
|
||||
verifyTime int64,
|
||||
verificationContext *VerificationContext,
|
||||
) error {
|
||||
_, err := verifySignature(
|
||||
keyRing.entities,
|
||||
message,
|
||||
signature.GetBinary(),
|
||||
verifyTime,
|
||||
verificationContext,
|
||||
)
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue