trestle.core.commands.verify
trestle.core.commands.verify ¤
Trestle Verify Command.
Attributes¤
logger = logging.getLogger(__name__) module-attribute ¤
Classes¤
VerifyCmd ¤
Bases: CommandBase
flowchart TD
trestle.core.commands.verify.VerifyCmd[VerifyCmd]
trestle.core.commands.command_docs.CommandBase[CommandBase]
trestle.core.commands.command_docs.CommandBase --> trestle.core.commands.verify.VerifyCmd
click trestle.core.commands.verify.VerifyCmd href "" "trestle.core.commands.verify.VerifyCmd"
click trestle.core.commands.command_docs.CommandBase href "" "trestle.core.commands.command_docs.CommandBase"
Verify a JSON file against a detached DSSE provenance envelope.
Verification performs two checks. First, it verifies the DSSE signature over the DSSE pre-authentication encoding for the in-toto Statement payload using the provided PEM public key. Second, it canonicalizes the input JSON using RFC 8785, computes its digest with the signed algorithm, and confirms that the digest matches the subject digest recorded in the signed Statement.
Both checks are required: the digest proves the file matches the signed subject, and the DSSE signature proves the Statement was signed by the corresponding private key. If the envelope was signed with a custom subject name, pass that same value with --subject-name.
Source code in trestle/core/commands/verify.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | |
Attributes¤
name = 'verify' class-attribute instance-attribute ¤
Methods:¤
verify(input_path, signature_path, public_key_path, subject_name=None, digest_algorithm=None) classmethod ¤
Verify a detached DSSE provenance envelope for a JSON file.
Source code in trestle/core/commands/verify.py
84 85 86 87 88 89 90 91 92 93 94 95 96 | |
Functions:¤
handler: python