You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: descriptor.md
+11-7Lines changed: 11 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,7 +57,7 @@ The following field keys are reserved and MUST NOT be used by other specificatio
57
57
All other fields may be included in other OCI specifications.
58
58
Extended _Descriptor_ field additions proposed in other OCI specifications SHOULD first be considered for addition into this specification.
59
59
60
-
## Digests and Verification
60
+
## Digests
61
61
62
62
The _digest_ property of a Descriptor acts as a content identifier, enabling [content addressability](http://en.wikipedia.org/wiki/Content-addressable_storage).
63
63
It uniquely identifies content by taking a [collision-resistant hash](https://en.wikipedia.org/wiki/Cryptographic_hash_function) of the bytes.
@@ -71,26 +71,30 @@ A digest string MUST match the following grammar:
71
71
```
72
72
digest := algorithm ":" encoded
73
73
algorithm := /[a-z0-9]+(?:[+._-][a-z0-9]+)*/
74
-
encoded := /[a-zA-Z0-9]+/
74
+
encoded := /[a-zA-Z0-9_-]+/
75
75
```
76
-
Some example digests include the following:
76
+
77
+
Some example digest strings include the following:
multihash+base58:QmRZxt2b1FVZPNqd8hsiykDL3TdBDeTSPX9Kv46HmX4Gx8` | Multihash | No |
84
+
sha256+b64:LCa0a2j_xo_5m0U8HTBBNBNCLXBkg7-g-YpeiGJm564 | SHA-256 with base64 | No |
83
85
84
86
Please see [Registered Algorithms](#registered-identifiers) for a list of supported algorithms.
85
87
86
88
Implementations SHOULD allow digests that are unsupported to pass validation if they comply with the above grammar.
87
89
While `sha256` will only use hex encoded digests, support for separators in _algorithm_ and alpha numeric in _encoded_ is included to allow for future extension of digest support.
88
90
As an example, we can paramterize the encoding and algorithm as `multihash+base58:QmRZxt2b1FVZPNqd8hsiykDL3TdBDeTSPX9Kv46HmX4Gx8`, which would be considered valid but unsupported by this specification.
89
91
90
-
* Before consuming content targeted by a descriptor from untrusted sources, the byte content SHOULD be verified against the digest string.
91
-
* Before calculating the digest, the size of the content SHOULD be verified to reduce hash collision space.
92
-
* Heavy processing before calculating a hash SHOULD be avoided.
93
-
* Implementations MAY employ [canonicalization](canonicalization.md) of the underlying content to ensure stable content identifiers.
92
+
### Verification
93
+
94
+
Before consuming content targeted by a descriptor from untrusted sources, the byte content SHOULD be verified against the digest string.
95
+
Before calculating the digest, the size of the content SHOULD be verified to reduce hash collision space.
96
+
Heavy processing before calculating a hash SHOULD be avoided.
97
+
Implementations MAY employ [canonicalization](canonicalization.md) of the underlying content to ensure stable content identifiers.
0 commit comments