XML security classes / The Signature class |
Methods for the xml.Signature class.
Name | Description |
---|---|
xml.Signature.Create() RETURNING sign xml.Signature |
Constructor of a blank Signature object. |
xml.Signature.CreateFromNode( signode xml.DomNode ) RETURNING sign xml.Signature |
Constructor of a new Signature object from a XML Signature node, according to the XML-Signature specification. |
Name | Description |
---|---|
xml.Signature.RetrieveObjectDataListFromSignatureNode( sign xml.DomNode, ind INTEGER ) RETURNING nodelist xml.DomNodeList |
Returns a DomNodeList containing all embedded XML nodes related to the signature object of index ind in the XML Signature node sign. |
Name | Description |
---|---|
setKey( key xml.CryptoKey ) |
Defines the key used for signing or validation. |
setCertificate( cert xml.CryptoX509 ) |
Defines the X509 certificate to be added to the Signature object when signing a document. |
Name | Description |
---|---|
setCanonicalization( url STRING ) |
Sets the canonicalization method to use for the signature. |
setID( id STRING ) |
Sets an ID value for the signature. |
Name | Description |
---|---|
getType() RETURNING str STRING |
Returns a string with the type of the Signature object. |
getDocument() RETURNING doc xml.DomDocument |
Returns a new DomDocument object representing the signature in XML. |
getCanonicalization() RETURNING ident STRING |
Returns one of the four canonicalization identifier of the signature. |
getID() RETURNING id STRING |
Returns the ID value of the signature. |
getSignatureMethod() RETURNING algo STRING |
Returns the algorithm method of the signature. |
Name | Description |
---|---|
createReference( uri STRING, digest STRING ) RETURNING ind INTEGER |
Creates a new reference that will be signed with the compute() method |
setReferenceID( ind INTEGER, value STRING ) |
Sets an ID value for the signature reference of index ind. |
appendReferenceTransformation( ind INTEGER, trans STRING, ... ) |
Appends a transformation related to the reference of index ind, and is executed before any computation |
Name | Description |
---|---|
getReferenceCount() RETURNING num INTEGER |
Returns the number of references in this Signature object. |
getReferenceURI( ind INTEGER ) RETURNING uri STRING |
Returns the URI of the reference of index ind in this Signature object. |
getReferenceDigest( ind INTEGER ) RETURNING algo STRING |
Returns the digest algorithm identifier of the reference of index ind in this Signature object. |
getReferenceID( ind INTEGER ) RETURNING value STRING |
Returns the ID value of the reference of index ind in this Signature object, or NULL if there is none. |
getReferenceTransformationCount( ind INTEGER ) RETURNING num INTEGER |
Returns the number of transformation related to the reference of index ind. |
getReferenceTransformation( ind INTEGER, pos INTEGER ) RETURNING ident STRING |
Gets the transformation identifier related to the reference of index ind at position pos in the list of transformation. |
Name | Description |
---|---|
createObject() RETURNING ind INTEGER |
Creates a new object that will embed additional XML nodes. |
setObjectID( ind INTEGER, value STRING ) |
Sets an ID value for the signature object of index ind. |
appendObjectData( ind INTEGER, node xml.DomNode ) |
Appends a copy of a XML node node to the signature object of index ind. |
Name | Description |
---|---|
getObjectCount() RETURNING num INTEGER |
Returns the number of objects in this Signature object. |
getObjectId( ind INTEGER ) RETURNING id STRING |
Returns the ID value of the signature object of index ind in this Signature object. |
Name | Description |
---|---|
compute( doc xml.DomDocument ) |
Computes the signature of all references set in this Signature object. |
verify( doc xml.DomDocument ) RETURNING flag INTEGER |
Verifies whether all references in this Signature object haven't changed. |
signString( key xml.CryptoKey, strToSign STRING ) RETURNING sig STRING |
Sign the passed string according to the specified key. |
verifyString( key xml.CryptoKey, signedStr STRING, signature STRING ) RETURNING flag INTEGER |
Verify the signature is consistent with the given key and the original message. |