sc14n  3.1.0
Public Types | Static Public Member Functions | List of all members
sc14n::C14n Class Reference

Perform C14N transformation of XML document. More...

Public Types

enum class  Tran {
  Default = 0x00 , Entire = 0x00 , OmitByTag = 0x01 , SubsetByTag = 0x02 ,
  OmitById = 0x11 , SubsetById = 0x12
}
 Transformation option to specify the document part to be canonicalized. More...
 
enum class  TranMethod { Inclusive = 0x0 , Exclusive = 0x100 , InclusiveWithComments = 0x800 , ExclusiveWithComments = 0x900 }
 Transformation method. More...
 
enum class  DigAlg {
  Default = 0x0 , Sha1 = 0x0 , Sha256 = 0x2000 , Sha384 = 0x3000 ,
  Sha512 = 0x5000
}
 Message digest algorithm. More...
 
enum  AdvOpts : unsigned int { None = 0x0 , Flatten = 0x10000 }
 Advanced option flags. More...
 

Static Public Member Functions

static int File2File (const std::string &outFile, const std::string &xmlFile, const std::string &nameOrId="", const Tran tranOpt=Tran::Entire, const TranMethod tranMethod=TranMethod::Inclusive, const std::string &exclParams="", const AdvOpts advOpts=AdvOpts::None)
 Perform C14N transformation of XML document (file-to-file). More...
 
static std::string File2String (const std::string &xmlFile, const std::string &nameOrId="", const Tran tranOpt=Tran::Entire, const TranMethod tranMethod=TranMethod::Inclusive, const std::string &exclParams="", const AdvOpts advOpts=AdvOpts::None)
 Perform C14N transformation of XML document (file-to-string). More...
 
static std::string File2Digest (const std::string &xmlFile, const std::string &nameOrId="", const Tran tranOpt=Tran::Entire, const DigAlg digAlg=DigAlg::Sha1, const TranMethod tranMethod=TranMethod::Inclusive, const std::string &exclParams="", const AdvOpts advOpts=AdvOpts::None)
 Compute digest value of C14N transformation of XML document (file-to-digest). More...
 
static std::string String2String (const std::string &xmlData, const std::string &nameOrId="", const Tran tranOpt=Tran::Entire, const TranMethod tranMethod=TranMethod::Inclusive, const std::string &exclParams="", const AdvOpts advOpts=AdvOpts::None)
 Perform C14N transformation of XML document (string-to-string). More...
 
static std::string String2Digest (const std::string &xmlData, const std::string &nameOrId="", const Tran tranOpt=Tran::Entire, const DigAlg digAlg=DigAlg::Sha1, const TranMethod tranMethod=TranMethod::Inclusive, const std::string &exclParams="", const AdvOpts advOpts=AdvOpts::None)
 Compute digest value of C14N transformation of XML document (string-to-digest). More...
 

Detailed Description

Perform C14N transformation of XML document.

Member Enumeration Documentation

◆ AdvOpts

enum sc14n::C14n::AdvOpts : unsigned int

Advanced option flags.

Enumerator
None 

No options.

Flatten 

Flatten the XML - remove all ignorable whitespace between tags.

◆ DigAlg

enum sc14n::C14n::DigAlg
strong

Message digest algorithm.

Enumerator
Default 

Use default digest algorithm (SHA-1).

Sha1 

Use SHA-1 digest algorithm (default).

Sha256 

Use SHA-256 digest algorithm.

Sha384 

Use SHA-384 digest algorithm.

Sha512 

Use SHA-512 digest algorithm.

◆ Tran

enum sc14n::C14n::Tran
strong

Transformation option to specify the document part to be canonicalized.

Enumerator
Default 

Default (transform entire document).

Entire 

Transform the entire document (default).

OmitByTag 

Omit the element with the given tag name.

SubsetByTag 

Transform the subset with the given tag name.

OmitById 

Omit the element with the given Id.

SubsetById 

Transform the subset with the given Id.

◆ TranMethod

Transformation method.

Enumerator
Inclusive 

Inclusive c14n without comments from RFC 3076 (default).

Exclusive 

Exclusive c14n without comments from RFC 3741.

InclusiveWithComments 

Inclusive c14n with comments from RFC 3076.

ExclusiveWithComments 

Exclusive c14n with comments from RFC 3741.

Member Function Documentation

◆ File2Digest()

static std::string sc14n::C14n::File2Digest ( const std::string &  xmlFile,
const std::string &  nameOrId = "",
const Tran  tranOpt = Tran::Entire,
const DigAlg  digAlg = DigAlg::Sha1,
const TranMethod  tranMethod = TranMethod::Inclusive,
const std::string &  exclParams = "",
const AdvOpts  advOpts = AdvOpts::None 
)
static

Compute digest value of C14N transformation of XML document (file-to-digest).

Parameters
xmlFileName of input XML file.
nameOrIdTag name or Id to include or omit.
tranOptTransformation option [default=Tran::Entire].
digAlgDigest algorithm [default=DigAlg::Sha1].
tranMethodTransformation method [default=TranMethod::Inclusive].
exclParamsInclusiveNamespaces PrefixList parameter for exclusive c14n [default = ""].
advOptsAdvanced option flags.
Returns
Message digest in base64-encoded string.

◆ File2File()

static int sc14n::C14n::File2File ( const std::string &  outFile,
const std::string &  xmlFile,
const std::string &  nameOrId = "",
const Tran  tranOpt = Tran::Entire,
const TranMethod  tranMethod = TranMethod::Inclusive,
const std::string &  exclParams = "",
const AdvOpts  advOpts = AdvOpts::None 
)
static

Perform C14N transformation of XML document (file-to-file).

Parameters
outFileName of output file to create.
xmlFileName of input XML file.
nameOrIdTag name or Id to include or omit.
tranOptTransformation option [default=Tran.Entire].
tranMethodTransformation method [default=TranMethod.Inclusive].
exclParamsInclusiveNamespaces PrefixList parameter for exclusive c14n [default = ""].
advOptsAdvanced option flags.
Returns
0 if successful or nonzero error code.

◆ File2String()

static std::string sc14n::C14n::File2String ( const std::string &  xmlFile,
const std::string &  nameOrId = "",
const Tran  tranOpt = Tran::Entire,
const TranMethod  tranMethod = TranMethod::Inclusive,
const std::string &  exclParams = "",
const AdvOpts  advOpts = AdvOpts::None 
)
static

Perform C14N transformation of XML document (file-to-string).

Parameters
xmlFileName of input XML file.
nameOrIdTag name or Id to include or omit.
tranOptTransformation option [default=Tran::Entire].
tranMethodTransformation method [default=TranMethod::Inclusive].
exclParamsInclusiveNamespaces PrefixList parameter for exclusive c14n [default = ""].
advOptsAdvanced option flags.
Returns
UTF-8-encoded string.

◆ String2Digest()

static std::string sc14n::C14n::String2Digest ( const std::string &  xmlData,
const std::string &  nameOrId = "",
const Tran  tranOpt = Tran::Entire,
const DigAlg  digAlg = DigAlg::Sha1,
const TranMethod  tranMethod = TranMethod::Inclusive,
const std::string &  exclParams = "",
const AdvOpts  advOpts = AdvOpts::None 
)
static

Compute digest value of C14N transformation of XML document (string-to-digest).

Parameters
xmlDataString containing XML data.
nameOrIdTag name or Id to include or omit.
tranOptTransformation option [default=Tran::Entire].
digAlgDigest algorithm [default=DigAlg::Sha1].
tranMethodTransformation method [default=TranMethod::Inclusive].
exclParamsInclusiveNamespaces PrefixList parameter for exclusive c14n [default = ""].
advOptsAdvanced option flags.
Returns
Message digest in base64-encoded string.

◆ String2String()

static std::string sc14n::C14n::String2String ( const std::string &  xmlData,
const std::string &  nameOrId = "",
const Tran  tranOpt = Tran::Entire,
const TranMethod  tranMethod = TranMethod::Inclusive,
const std::string &  exclParams = "",
const AdvOpts  advOpts = AdvOpts::None 
)
static

Perform C14N transformation of XML document (string-to-string).

Parameters
xmlDataString containing XML data.
nameOrIdTag name or Id to include or omit.
tranOptTransformation option [default=Tran::Entire].
tranMethodTransformation method [default=TranMethod::Inclusive].
exclParamsInclusiveNamespaces PrefixList parameter for exclusive c14n [default = ""].
advOptsAdvanced option flags.
Returns
UTF-8-encoded string.
Copyright © 2017-21 D.I. Management Services Pty Limited ABN 78 083 210 584 Australia. All rights reserved. <www.di-mgt.com.au> <www.cryptosys.net>. Generated on Tue Apr 5 2022 17:40:37 by Doxygen 1.9.1.