This page shows how to use the various programming interfaces to SC14N with documentation and example code.
.NET | C/C++ | VBA/VB6 | Python | Verifying XML‑DSIG docs | Contact us
C:\Program Files (x86)\Sc14n
unless you chose otherwise during installation.
You can find the files by using the Windows menu options
Start > All Programs > Sc14n > Sc14n Reference Files
There is a set of test files in the installation directory
C:\Program Files (x86)\Sc14n\TestFiles
.
You should make a copy of these to a less-protected directory for doing tests.
Or you can download the zipped files directly.
To use the .NET interface with C# and VB.NET (VB2010+):
diSc14nNet.dll
(installed by default in C:\Program Files (x86)\Sc14n\DotNet
).
using Sc14n;
or (for VB.NET)
Imports Sc14n
C# test programs: TestSc14n.cs and TestSc14nPki.cs
VB.NET test programs: TestSc14n.vb and TestSc14nPki.vb.
Documentation: Sc14n Namespace .NET Help.
To use with a C or C++ program, include the diSc14n.h file with your source code and link with the diSc14n.lib
library
(the install program puts these files by default in
C:\Program Files (x86)\Sc14n\C
)
Example test programs in C: TestSc14n.c and TestSc14nPKI.c.
Documentation: Reference manual for C/C++ programmers.
Add the module basSc14n.bas
to your project.
(the install program puts this file by default in
C:\Program Files (x86)\Sc14n\VBA
).
Use the module basUtf8FromString.bas
to convert between VBA Unicode strings and UTF-8-encoded byte arrays.
Example test programs in VBA: TestSc14n.bas.
See Python Interface to SC14N.
Example test programs in Python: test-sc14n.py and test_sc14n_pki.py.
Documentation: Sc14n Py documentation.
The test files folder "TestFiles\signed" contains various files that have been signed using "Alice's" signing key and should pass as valid on the Online XML Digital Signature Verifer.
We find the best way to test is to open the XML file using NotePad++, select all (Ctrl-A), then copy and paste onto the web page. This seems to prevent character encoding errors when using the clipboard.
If you still get an "encoding error" because of a non-ASCII character, then replace the offending character, say é (U+00E9 latin small letter e with acute), with its character reference "é"
.
These test signed XML documents include the <KeyInfo> as an <RSAKeyValue>. This is required by the Verifier site if you are using a test key like we are. In practice you'd probably be using a <X509Certificate> element instead.
Some examples include inline DTD !ATTLIST
instructions which are required if you're using an Id reference like URI="#foo"
on the xmldsig-verifier site.
2022-03-20: See
Troubleshooting problems on the 'Online XML Digital Signature Verifier' site
To contact us or comment on this page, please send us a message.
This page last updated 15 November 2022