Marmos
v juptune
v asn1
v lang
v ast
v Classes
v Enums
v ir
v parser
v Enums
v Structs
v core
v crypto
v keyexchange
v memory
v data
v alphabet
v buffer
v json
v builder
v parser
v Enums
v Structs
v serialise
v Structs
v Templates
v pem
v Enums
v Structs

Functions x509FromAsn1

1
2
3
4
5
6

Documentation

Flattens the given asn1Certinto the more easier to use structure of cert, while performing light amounts of validation.

Further validation has to be handled outside of this function as it requires additional context on how the certificate is even being used. The rest of the x509 package should handle most of their respective checks for you.

Notes

This function only allocates memory for providing descriptive error messages. If no error is returned then no memory is allocated.

This leads to a slightly awkward design where user code must call auxilary functions such as x509ForeachNameComponentto deal with array types, for the tradeoff of allowing the user code to have maximum flexbility around how to deal with its own memory.

The lifetime of certis directly tied to asn1Cert, which in turn is tied to the underlying ubyte[]that it was decoded from. You MUST keep the original underlying ubyte[]allocated and unmodified while using either form of the x509 certificate.

Params

Throws

Anything that x509IdentifySignatureAlgorithmcan throw.

Anything that x509IdentifyPublicKeyAlgorithmcan throw.

Anything that x509HandleTimecan throw.

X509Error.signatureAlgorithmMismatchif there's a mismatch between the signatureand signatureAlgorithmfields.

X509Error.invalidCertVersionif the certificate is of an unsupported/invalid version.

X509Error.uniqueIdentifiersWrongVersionif the certificate contains an unique identifier with a version that does not suport them.

X509Error.extensionsWrongVersionif the certificate contains extensions with a version that does not suport them.

Returns

An errorful Resultif something went wrong.