trestle.core.signing
trestle.core.signing ¤
Helpers for detached JSON provenance signatures.
Attributes¤
CANONICALIZATION_ALGORITHM = 'RFC8785' module-attribute ¤
DEFAULT_DIGEST_ALGORITHM = Algorithm.SHA_256 module-attribute ¤
DIGEST_SOURCE = 'canonical-json' module-attribute ¤
DSSE_PAYLOAD_TYPE = 'application/vnd.in-toto+json' module-attribute ¤
IN_TOTO_STATEMENT_TYPE = 'https://in-toto.io/Statement/v1' module-attribute ¤
MAX_SIGNATURES = 16 module-attribute ¤
OSCAL_PREDICATE_TYPE = 'https://oscal-compass.github.io/compliance-trestle/predicates/oscal-signing/v1' module-attribute ¤
Classes¤
Functions:¤
build_in_toto_statement(subject_name, digest, digest_algorithm=DEFAULT_DIGEST_ALGORITHM) ¤
Build the in-toto Statement payload for a JSON artifact digest.
Source code in trestle/core/signing.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | |
create_oscal_provenance_envelope(input_path, signer, subject_name=None, digest_algorithm=DEFAULT_DIGEST_ALGORITHM) ¤
Create a DSSE envelope whose payload is an in-toto Statement for a JSON file.
Source code in trestle/core/signing.py
107 108 109 110 111 112 113 114 115 116 117 118 | |
dsse_pae(payload_type, payload) ¤
Return DSSE pre-authentication encoding for a payload type and payload.
Source code in trestle/core/signing.py
93 94 95 96 97 98 99 100 101 102 103 104 | |
load_dsse_envelope(envelope_path) ¤
Load a DSSE envelope from JSON.
Source code in trestle/core/signing.py
163 164 165 166 167 168 169 | |
load_in_toto_statement(payload) ¤
Load a verified DSSE payload as an in-toto Statement object.
Source code in trestle/core/signing.py
192 193 194 | |
load_pem_private_key_signer(path, password=None) ¤
Load a local PEM private key as a securesystemslib signer.
Source code in trestle/core/signing.py
56 57 58 59 60 61 62 63 | |
load_pem_public_key(path) ¤
Load a local PEM public key as a securesystemslib key.
Source code in trestle/core/signing.py
66 67 68 69 70 71 72 | |
sign_in_toto_statement(statement, signer) ¤
Sign an in-toto Statement as a DSSE envelope.
Source code in trestle/core/signing.py
121 122 123 124 125 126 127 128 129 | |
verify_dsse_payload(envelope, public_key) ¤
Verify a DSSE envelope signature and return its payload bytes.
Source code in trestle/core/signing.py
187 188 189 | |
verify_oscal_provenance_envelope(input_path, envelope, public_key, subject_name=None, digest_algorithm=None) ¤
Verify a JSON file, detecting the signed digest algorithm unless one is required.
Source code in trestle/core/signing.py
172 173 174 175 176 177 178 179 180 181 182 183 184 | |
write_dsse_envelope(envelope, output_path, overwrite=False) ¤
Write a DSSE envelope as JSON, optionally replacing an existing file.
Source code in trestle/core/signing.py
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | |
handler: python