Module xmlrat_dsig

Implementation of XML Digital Signature (DSIG).

Description

Implementation of XML Digital Signature (DSIG).

See W3C Recommendation: XML Signature Syntax and Processing Version 1.1.

Features supported: The behaviours xmlrat_dsig_signer and xmlrat_dsig_verifier allow providing a callback module to customise the behaviour of xmlrat_dsig with respect to obtaining and using private keys and validating public keys and certificates.

Data Types

id()

id() = binary()

sign_options()

sign_options() = #{signer_options => map(), signer => module(), detached => boolean(), signed_elements => [id()], hash_preferences => [xmlrat_dsig_signer:hash_algo()]}

verify_options()

verify_options() = #{verifier_options => map(), verifier => module()}

Function Index

sign/2Signs an XML document.
verify/2Verifies an enveloped XML-DSIG signature.
verify/3Verifies a detached XML-DSIG signature.

Function Details

sign/2

sign(Doc::xmlrat:document(), Opts0::sign_options()) -> {ok, xmlrat:document()} | {error, term()}

Signs an XML document.

Returns either the complete enveloped document with signature (if detached is false, the default); or just the detached signature document.

verify/2

verify(Doc::xmlrat:document(), Opts::verify_options()) -> ok | {error, term()}

Verifies an enveloped XML-DSIG signature.

verify/3

verify(SignedDoc::xmlrat:document(), SigDoc::xmlrat:document(), Opts::verify_options()) -> ok | {error, term()}

Verifies a detached XML-DSIG signature.


Generated by EDoc