Implementation of XML Digital Signature (DSIG).
See W3C Recommendation: XML Signature Syntax and Processing Version 1.1.
Features supported: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.
id() = binary()
sign_options() = #{signer_options => map(), signer => module(), detached => boolean(), signed_elements => [id()], hash_preferences => [xmlrat_dsig_signer:hash_algo()]}
verify_options() = #{verifier_options => map(), verifier => module()}
sign/2 | Signs an XML document. |
verify/2 | Verifies an enveloped XML-DSIG signature. |
verify/3 | Verifies a detached XML-DSIG signature. |
sign(Doc::xmlrat:document(), Opts0::sign_options()) -> {ok, xmlrat:document()} | {error, term()}
Signs an XML document.
Returns either the complete enveloped document with signature (ifdetached
is false
, the default); or just the
detached signature document.
verify(Doc::xmlrat:document(), Opts::verify_options()) -> ok | {error, term()}
Verifies an enveloped XML-DSIG signature.
verify(SignedDoc::xmlrat:document(), SigDoc::xmlrat:document(), Opts::verify_options()) -> ok | {error, term()}
Verifies a detached XML-DSIG signature.
Generated by EDoc