11; This c509 Certificate format is based upon:
2- ; https://datatracker.ietf.org/doc/draft-ietf-cose-cbor-encoded-cert/09 /
2+ ; https://datatracker.ietf.org/doc/draft-ietf-cose-cbor-encoded-cert/11 /
33; And is restricted/customized to better enable compatibility with Plutus scripts
44; that would consume them, without loosing necessary features of x509
55; Not all x509 features are supported and some fields have different semantics to improve
@@ -11,42 +11,32 @@ C509CertificatePlutusRestrictedSubset = [ TBSCertificate, issuerSignatureValue:
1111
1212; The elements of the following group are used in a CBOR Sequence:
1313TBSCertificate = (
14- c509CertificateType: &c509CertificateTypeValues , ; Always 0
14+ c509CertificateType: int , ; Always 2 as natively signed C509 certificate following X.509 v3
1515 certificateSerialNumber: CertificateSerialNumber, ; Can be ignored/set to 0 or used as intended.
16- issuer: Name, ; This could be an on-chain reference to the issuer cert, what would be the best way? Transaction hash/cert hash?
17- validityNotBefore: Time, ; c509 uses UTC
18- validityNotAfter: Time, ; c509 uses UTC
16+ issuerSignatureAlgorithm: AlgorithmIdentifier, ; Must be int(12) = Ed25519
17+ issuer: Name / null, ; If set to null, use the `subject`. This could be an on-chain reference to
18+ the issuer cert, what would be the best way? Transaction hash/cert hash?
19+ validityNotBefore: ~time, ; UTC
20+ validityNotAfter: ~time / null, ; UTC
1921 subject: Name, ; Reference to on-chain keys related to this certificate
2022 subjectPublicKeyAlgorithm: AlgorithmIdentifier, ; Must be int(12) = Ed25519
21- subjectPublicKey: subjectPublicKey, ; Ed25519 public key
22- extensions: Extensions, ; No extensions are currently supported must be set to []
23- issuerSignatureAlgorithm: AlgorithmIdentifier, ; Must be int(12) = Ed25519
24- )
25-
26- ; 0 = Native CBOR Certificate type
27- ; 1 = reencoded-der-cert - Not supported in this restricted version of the format.
28- c509CertificateTypeValues = ( native-cbor: 0,
29- ; reencoded-der: 1 ; Not supported in this restricted encoding format
23+ subjectPublicKey: any, ; Ed25519 public key
24+ extensions: Extensions, ; Currently support extensions with basic CBOR types and Alternative Name
3025)
3126
32- CertificateSerialNumber = biguint
33-
34- Name = [ * RelativeDistinguishedName ]
35- / text
36- / bytes
27+ CertificateSerialNumber = ~biguint
3728
38- RelativeDistinguishedName = Attribute / [ 2 * Attribute ]
29+ Name = [ * Attribute ] / text / bytes
3930
4031Attribute = (
4132 ( attributeType: int, attributeValue: text )
4233 // ( attributeType: oid, attributeValue: bytes )
43- // ( attributeType: pen, attributeValue: bytes )
4434 // CardanoPublicKey
4535)
4636
4737subjectPublicKey = bytes .size (32..32); Ed25519 public key stored in bytes, adjust size of this if other key types are supported.
4838
49- ; This is a completely custom Attribute for the RelativeDistinguishedName which is only for use with Plutus scripts.
39+ ; This is a completely custom Attribute, which is only for use with Plutus scripts.
5040; attributeType = The type of Cardano key we associate with this certificate.
5141; proof = Does the transaction require proof that the key is owned by the transaction signer?
5242; attributeValue = The Cardano public key hash of the attribute type
@@ -61,14 +51,12 @@ cardanoKeyTypes = (
6151 ccHotVerificationKeyHash: 4,
6252)
6353
64- ; Plutus will need to convert the Unix epoch timestamp to the nearest slot number
54+ ; For `~time` Plutus will need to convert the Unix epoch timestamp to the nearest slot number
6555; validityNotBefore rounds up to the next Slot after that time.
6656; validityNotAfter rounds down to the next Slot before that time.
67- Time = ( ~time / null )
6857
6958ed25519Signature = bstr .size 64; Ed25519 signature must be tagged to identify their type.
7059
71-
7260; Currently ONLY AlgorithmIdentifier int(12) - Ed25519 is supported.
7361; oid and [ algorithm: oid, parameters: bytes ] are not supported by Plutus.
7462AlgorithmIdentifier = (int
@@ -82,5 +70,4 @@ Extensions = [ * Extension ] / int
8270Extension = (
8371 ( extensionID: int, extensionValue: any )
8472 // ( extensionID: ~oid, ? critical: true, extensionValue: bytes )
85- // ( extensionID: pen, ? critical: true, extensionValue: bytes )
8673)
0 commit comments