You can create most of the cryptographic elements required in the
[XML-DSIG] and [XML-ENC] specifications to insert into XML documents.
These XML values should be encoded in base64 encoding.
Use
CNV_B64StrFromBytes or
Cnv.ToBase64
to convert byte arrays into base64 encoding.
Here is a selection of some elements you can create.
SignatureValue element
Use
Sig.SignData
or
Sig.SignFile.
Alternatively, use
Rsa.EncodeMsgForSignature followed by
Rsa.RawPrivate
then
Cnv.ToBase64.
DigestValue elementUse
Hash.BytesFromBytes
or
Hash.BytesFromFile
then
Cnv.ToBase64.
X509Certificate elementX509IssuerSerial elementUse
X509.QueryCert with query "serialNumber" and
X509.OutputOpts.Decimal.
X509SubjectName elementUse
X509.QueryCert with query "subjectName" and
X509.OutputOpts.Ldap.
RSAKeyValue element
Use
Rsa.KeyValue or
Rsa.ToXMLString.
RSAKeyPair element
Use
Rsa.ToXMLString.
CipherValue element
xmlenc#rsa-1_5:
Use
Rsa.EncodeMsgForEncryption
with Rsa.EME.PKCSv1_5 option
followed by
Rsa.RawPublic
then
Cnv.ToBase64
xmlenc#rsa-oaep-mgf1p:
As for xmlenc#rsa-1_5 except use
Rsa.EME.OAEP option.
xmlenc#tripledes-cbc: Use
Cipher.Encrypt
with options
CipherAlgorithm.Tdea,
Mode.CBC and
padding.Pkcs5,
then
Cnv.ToBase64.
xmlenc#aes128-cbc:
As for xmlenc#tripledes-cbc except use
CipherAlgorithm.Aes128 option.
xmlenc#aes192-cbc:
As for xmlenc#tripledes-cbc except use
CipherAlgorithm.Aes192 option.
xmlenc#aes256-cbc:
As for xmlenc#tripledes-cbc except use
CipherAlgorithm.Aes256 option.