dp:verify()
Verifies a digital signature.
Namespace declaration
xmlns:dp="http://www.datapower.com/extensions"
Syntax
dp:verify(algorithm, hash, value, certificate)
Parameters
- algorithm
- The
xs:stringthat identifies the signature algorithm and must take one of the following values.http://www.w3.org/2000/09/xmldsig#dsa-sha1http://www.w3.org/2000/09/xmldsig#rsa-psshttp://www.w3.org/2000/09/xmldsig#rsa-sha1http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha224http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512http://www.w3.org/2001/04/xmldsig-more#rsa-md5http://www.w3.org/2001/04/xmldsig-more#rsa-ripemd160http://www.w3.org/2001/04/xmldsig-more#rsa-sha256http://www.w3.org/2001/04/xmldsig-more#rsa-sha384http://www.w3.org/2001/04/xmldsig-more#rsa-sha512
- hash
- The
xs:stringthat identifies the locally calculated hash of the<SignedInfo>element of the XML signature. - value
- The
xs:stringthat is derived from the contents of the<Signature Value>element of the XML signature and contains the digital signature to be verified. - certificate
- The
xs:stringthat identifies the X.509 certificate that contains the public key of the XML signatory. The target certificate can be identified in any of the following ways.name:certname:- Indicates the literal prefix for a certificate alias.
- cert
- Specifies the name of an X.509 cryptographic certificate alias.
cert:base64Certcert:- Indicates the literal prefix for a base-64 encoded certificate.
- base64Cert
- Specifies that the target certificate is base-64 encoded.
ski:certSKIski:- Indicates the literal prefix for a certificate where the Subject Key Identifier (SKI) is used as the identifier.
- certSKI
- Specifies that the target certificate is the base-64 encoding of the SKI.
issuerserial:serialissuerserial:- Indicates the literal prefix for a certificate where the issuer serial number and DN is used as the identifier.
- serial
- Specifies the issuer serial number as a decimal integer and the issuer DN; for example,
0,CN=Harold, O=Acme, L=Someplace, ST=MA, C=US. The function uses this value to search the management store for a matching certificate. The issuer DN must be in LDAP format. Autodetection of the DN format is deprecated in this release. When the auto-detection option is removed in a future release, you cannot look up certificates by specifying the issuer DN in non-LDAP format.
thumbprintsha1:sha1stringthumbprintsha1:- Indicates the literal prefix for a certificate with a base-64 encoded SHA-1 hash.
- sha1string
- Specifies a base-64 encoded SHA-1 hash of a certificate. The function uses this value to search the management store for the SHA-1 hash of a matching certificate.
pkcs7:base64Certpkcs7:- Indicates the literal prefix for a certificate that is identified as the first certificate in an unordered collection of certificates.
- base64Cert
- Specifies a string of base-64 encoded ASN.1 objects with multiple certificates. The function uses the first certificate that it finds in the string.
pkipath:base64certpkipath:- Indicates the literal prefix for a certificate that is identified as the last certificate in an ordered collection of certificates.
- base64cert
- Specifies a string of base-64 encoded ASN.1 objects with multiple certificates. The function uses the last certificate that it finds in the string.
Guidelines
Verifies a digital signature as specified in W3C Recommendation 12 February 2002, IETF RFC 3275 XML - Signature Syntax and Processing.
The extension passes all arguments as XPath expressions.
Results
An empty xs:string if signature verification succeeds; otherwise, returns an
error string.
Example
⋯
<xsl:variable name="verify-result" select='dp:verify($algorithm,$hash,$value,$certificate)'/>
⋯