CERN DomainKeys Library-A C# version implement
Because the original page is not available now, so make a backup here.
DomainKeys Library
Library Information
CERN DomainKeys Library is written in C#, for a Windows usage.
Common task is to integrate this library into Protocol Event Sinks,
implementing ISmtpInCommandSink interface, for incoming traffic verification
and outgoing traffic signing.
An ISmtpServerResponseSink Sink might also be used for signing outgoing
traffic.It uses a certificate generated by OpenSSL, and imported in LocalMachine
certificate store. The public key is extracted using OpenSSL for DNS field.Download
CERN DomainKeys Library.zip(v1.0) (updated on 08 Feb 2005, small canonicalizer bug corrected).
Usage
Create certificate and export public key:
If needed, create CA to Issue certificates:
openssl req -x509 -out ca_cert.pem -newkey rsa:1024 -keyout ca_priv_key.pem
-days 365- Request Certificate:
openssl req -out DomainKeys_cert_req.pem -new -keyout DomainKeys_priv_key.pem
-newkey rsa:768- As CA, Issue Certificate:
openssl x509 -req -in DomainKeys_cert_req.pem -CA ca_cert.pem -CAkey
ca_priv_key.pem -CAcreateserial -out DomainKeys_cert.pem -days 365- Export public key for DNS TXT field:
openssl rsa -in DomainKeys_priv_key.pem -out DomainKeys_public_Key.pem -pubout
-outform PEM- Finally, create a PKCS12 file from the PEM certificate:
openssl pkcs12 -export -in DomainKeys_cert.pem -inkey DomainKeys_priv_key.pem
-out DomainKeys_cert.p12 -name "DomainKeys certificate"- Import the .p12 certificate into Certificate Store, in LocalMachine / Personal.
Verify that ‘Make private key as exportable’ is checked.Configure library:
- Edit Constants.cs according to your requirements (domain, headers, etc…).
Edit Logger.cs to set a logging method according to your preferences.
Sign outgoing mails:
MailSigner ms = new MailSigner(); if (ms.signMail(mail_to_sign)) { // Add new header at top on mail: string mail_signed = ms.signedHeader + mail_to_sign; }Verify incoming mails:
MailAnalyser mDK = new MailAnalyser(); if (mDK.SignatureVerify(mail_to_verify) == true) { // Accept mail, does not mean verification is good. // Check mDK.checkStatusStr for status. // Add status to mail: mDK.checkStatusHeader contains header line with result. } else { // Reject mail: Verify failed, and sending domain says all mails should be signed. }
iText 5.0.0 need java 5 and under AGPL
iText 5.0.0 released on December 7, 2009, and I noticed it has some big changes need you to pay attention to,
- Changed the license from MPL/LGPL to AGPL
- iText.jar is now compiled with Java 5
- Changed the package names from com.lowagie to com.itextpdf
Convert PDF to DXF with Free Open Source Software pstoedit and Ghostscript
pstoedit+ghostscript
1.download the last version pstoedit and ghostscript
2.install pstoedit and ghostscript
3 run command pstoedit -f dxf in.pdf out.dxf(make sure pstoedit can find the path of gswin32c.exe)
pstoedit+gsview
1.download the last version pstoedit and gsview
2.install pstoedit and gsview
3. use pstoedit as a plugin of gsview
pstoedit is a tool converting PostScript and PDF files into various other formats suported by different drawing editors. As a prerequesite it needs GhostScript to be installed (binary installation is sufficient).
Currently pstoedit can generate the following major formats:
- Tgif .obj format (for tgif version >= 3)
- .fig format for xfig
- pdf – Adobe’s Portable Document Format
- gnuplot format
- Flattened PostScript (with or without Bezier curves)
- DXF – CAD exchange format
- LWO – LightWave 3D
- RIB – RenderMan
- RPL – Real3D
- Java 1 or Java 2 applet
- Idraw format (in fact a special form of EPS that idraw can read)
- Tcl/Tk
- HPGL
- AI (Adobe Illustrator) (based on ps2ai.ps – not a real
pstoedit driver – see notes below and manual)- Windows Meta Files (WMF) (Windows only)
- Enhanced Windows Meta Files (EMF) (Windows, but also Linux/Unix if
libemf is available)- OS/2 meta files (OS/2 only)
- PIC format for troff/groff
- MetaPost format for usage with TeX/LaTeX
- LaTeX2e picture
- Kontour
- GNU Metafile (plotutils / libplot)
- Skencil ( http://www.skencil.org)
- Mathematica
- via ImageMagick to any format supported by ImageMagick
- SWF
- CNC G code
- VTK files for ParaView and similar visualization tools
From above cheat, we know pstoedit supports generate DXF, but it needs the help of Ghostscript or GsView
Ghostscript is the name of a set of software that provides:
* An interpreter for the PostScript (TM) language and the Adobe Portable Document Format (PDF — sometimes confused with Acrobat, Adobe’s PDF browser/editor product), and
* A set of C procedures (the Ghostscript library) that implement the graphics and filtering (data compression / decompression / conversion) capabilities that appear as primitive operations in the PostScript language and in PDF.
reference,
GPL Ghostscript
GSview
pstoedit