cometa-0.1.0.0: Idiomatic Haskell bindings to cardano-c
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cometa.Certificate.Collection

Description

Ordered certificate collections. Order and duplicate certificates are retained. An exact envelope preserves imported tagging and integer encodings.

import qualified Cometa.Certificate.Collection as Certificates

noCertificates :: Certificates.Certificates
noCertificates = Certificates.empty
Synopsis

Documentation

data Certificates Source #

Ordered certificates. Order and repeated certificates are preserved, matching the native certificate collection despite its historical set name.

Instances

Instances details
Show Certificates Source # 
Instance details

Defined in Cometa.Internal.Certificate

Eq Certificates Source # 
Instance details

Defined in Cometa.Internal.Certificate

Ord Certificates Source # 
Instance details

Defined in Cometa.Internal.Certificate

empty :: Certificates Source #

No certificates.

fromList :: [Certificate] -> Certificates Source #

Assemble certificates in transaction order, preserving duplicates.

toList :: Certificates -> [Certificate] Source #

Certificates in their original order, including duplicates.

encodeCbor :: Certificates -> ByteString Source #

Fresh definite array with set tag 258, preserving order and duplicates.

encodeCborWith :: SetEncoding -> Certificates -> ByteString Source #

Fresh definite array with the requested outer set tag. Nested certificates keep their usual encoding; order and repeated certificates remain unchanged.

setEncoding :: EncodedCertificates -> SetEncoding Source #

Observe the exact envelope's outer set tag.

withSetEncoding :: SetEncoding -> EncodedCertificates -> EncodedCertificates Source #

Change only the outer set tag, preserving every array and certificate byte. Requesting the current representation preserves the complete encoding exactly.

data EncodedCertificates Source #

Ordered certificates retaining their complete imported CBOR envelope.

decodeCbor :: ByteString -> Either Error EncodedCertificates Source #

Validate a complete certificate array with an optional set tag 258. Definite and indefinite arrays are accepted. Certificates obey the checks in decodeCbor. Invalid input and trailing bytes return InvalidCertificateCbor. Exact bytes, including tag absence, remain available through toCbor.

fromCertificates :: Certificates -> EncodedCertificates Source #

Wrap an ordered collection using its fresh definite encoding.

toCertificates :: EncodedCertificates -> Certificates Source #

Inspect the ordered semantic collection.

toCbor :: EncodedCertificates -> ByteString Source #

Return the exact imported or freshly assembled encoding.