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

Aliases X509CertificateStore.validateChainFromCopyingDerBytes

1
2
3

Documentation

Validates a chain of certificates (or a "chain" with a single certificate) from the given raw DER encoded bytes. These certificates are not loaded into the store, and are immediately freed upon exit of this function.

Notes

When the nextInChainparameter returns true, it must populate its parameter with a byte slice of a DER encoded ASN.1 x.509 Certificatestructure. This memory is immediately copied, so nextInChainis free to reuse any internal buffers it exposes to this function.

When nextInChainis unable to provide another certificate, it must return false. It should leave its parameter as nullin this case.

Security Policy

allowSelfSignedChain** = If the first certificate in the chain is self-signed; this value is false, and the self-signed certificate has not been previously loaded into the store, then the chain is rejected. However if this value is true, the chain will continue to be validated using the first certificate as the trust anchor if the first certificate is self-signed.

Params

policy = The security policy to apply to this function, please see "Security Policy" for important info. reverseChain = If true, then the chain will be reversed before being validated. This is useful for when nextInChainis handling PEM input, as PEM certificates store chains in reverse order. Throws: Anything that the underlying ASN.1 decoder functions can throw (`Asn1DecodeError`).

Anything that x509FromAsn1can throw.

Anything that X509ExtensionStore.fromCertificatecan throw.

Anything that x509ValidatePathcan throw.

X509StoreError.trustAnchorNotFoundif a trust anchor could not be determined, and if the first certificate in the chain could not be used as the trust anchor (see Security Policy).

X509StoreError.noCertificatesif nextInChaindoesn't generate any certificates.

Returns

A Resultindicating if an error occurred or not.