XmlDigitalSignature
Namespace: Babel.Licensing Assembly: Babel.Licensing.dll
Provides a means to read and validate and digitally sign XML documents.
Inheritance
Implements
ISignatureProvider, ISignatureWriter, IRSAKeys, ISignatureKeyInfo
Inherited Members
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors
XmlDigitalSignature(RSA)
Initializes a new instance of the class with the specified RSA algorithm.
Parameters
The RSA algorithm.
Exceptions
Thrown when the rsa argument is null.
XmlDigitalSignature(RSA, bool)
Initializes a new instance of the class with the specified RSA algorithm.
Parameters
The RSA algorithm.
true to add public key information to signature element, false if not.
Exceptions
Thrown when one or more required arguments are null.
Fields
XmlDSigNamespace
The XML digital signature namespace.
Field Value
Properties
AlgorithmName
Gets the name of the sign algorithm.
Property Value
GenerateKeyInfo
Gets or sets a value indicating whether the generate key information.
Property Value
HasKeySize
Gets a value indicating whether this object has key size.
Property Value
HasPrivateKey
Gets a value indicating whether this object has private key.
Property Value
HasPublicKey
Gets a value indicating whether this object has public key.
Property Value
KeyPair
Gets or sets the RSA key pair.
Property Value
byte[]
KeySize
Gets the key size.
Property Value
RSA
Gets or sets the algorithm.
Property Value
SignatureValue
Gets the signature value.
Property Value
byte[]
Methods
CreateFromKeyContainer(string)
Creates an instance of from the specified key container.
Parameters
The key container name.
Returns
The created object.
Exceptions
Thrown when the container argument is null.
CreateFromKeyFile(string, string)
Creates an instance of from the specified key pair file.
Parameters
The key pair file path. This can be an SNK or PFX file.
(Optional) the key password.
Returns
The created object.
Exceptions
Thrown when the keyFile argument is null.
CreateFromSignedXml(string)
Creates an object from the digitally signed XML document.
Parameters
The digitally signed XML document.
Returns
The created object.
Exceptions
Thrown when one or more required arguments are null.
Thrown when the XML is not digitally signed.
LoadXml(string)
Loads an XML file to sign.
Parameters
The XML document.
Exceptions
Thrown when one or more required arguments are null.
Sign()
Sign the XML.
ToRSASignature()
Converts this object to an object.
Returns
The object.
VerifySignature()
Verify the XML digital signature.
Returns
true if the signature is valid, false if not.
WritePem(string, bool)
Writes the signature using PEM format to the specified file.
Parameters
The file path.
Whether to write only public key data.
Exceptions
Thrown when one or more required arguments are null.
Thrown when one or more arguments have unsupported or illegal values.
WritePem(Stream, bool)
Writes the signature using PEM format to the specified stream.
Parameters
The stream to write.
Whether to write only public key data.
Exceptions
Thrown when one or more required arguments are null.
WriteXml(XmlWriter)
Writes the XML to the specified .
Parameters
writer
XmlWriter
The XML writer.
Exceptions
Thrown when one or more required arguments are null.
See Also
Last updated