Class CryptographicStandard
Specifies the cryptographic standard.
Inheritance
System.Object
CryptographicStandard
Namespace: Syncfusion.Pdf.Security
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public sealed class CryptographicStandard : Enum
Examples
//Creates a new PDF document.
PdfDocument document = new PdfDocument();
//Adds a new page.
PdfPageBase page = document.Pages.Add();
PdfGraphics graphics = page.Graphics;
//Creates a certificate instance from PFX file with private key.
PdfCertificate pdfCert = new PdfCertificate(@"PDF.pfx", "syncfusion");
//Creates a digital signature.
PdfSignature signature = new PdfSignature(document, page, pdfCert, "Signature");
//Sets signature settings to customize digestion algorithm and cryptographic standrad specified
PdfSignatureSettings properties = signature.Settings;
properties.CryptographicStandard = CryptographicStandard.CADES;
//Sets an image for signature field.
PdfBitmap signatureImage = new PdfBitmap(@"signature.jpg");
//Sets signature information
signature.Bounds = new RectangleF(new PointF(0, 0), signatureImage.PhysicalDimension);
signature.ContactInfo = "johndoe@owned.us";
signature.LocationInfo = "Honolulu, Hawaii";
signature.Reason = "I am author of this document.";
//Draws the signature image.
graphics.DrawImage(signatureImage, 0, 0);
//Saves and closes the document.
document.Save("Output.pdf");
document.Close(true);
'Creates a new PDF document.
Dim document As New PdfDocument()
'Adds a new page.
Dim page As PdfPageBase = document.Pages.Add()
Dim graphics As PdfGraphics = page.Graphics
'Creates a certificate instance from PFX file with private key.
Dim pdfCert As New PdfCertificate("PDF.pfx", "syncfusion")
'Creates a digital signature.
Dim signature As New PdfSignature(document, page, pdfCert, "Signature")
'Sets signature settings to customize digestion algorithm and cryptographic standrad specified
Dim properties As PdfSignatureSettings = signature.Settings;
properties.CryptographicStandard = CryptographicStandard.CADES;
'Sets an image for signature field.
Dim signatureImage As New PdfBitmap("signature.jpg")
'Sets signature info.
signature.Bounds = New RectangleF(New PointF(0, 0), signatureImage.PhysicalDimension)
signature.ContactInfo = "johndoe@owned.us"
signature.LocationInfo = "Honolulu, Hawaii"
signature.Reason = "I am author of this document."
'Draws the signature image.
graphics.DrawImage(signatureImage, 0, 0)
'Saves and closes the document.
document.Save("Output.pdf")
document.Close(True)
Fields
CADES
CMS Advanced Electronic Signatures
Declaration
public const CryptographicStandard CADES
Field Value
Type |
---|
CryptographicStandard |
CMS
Cryptographic Message Syntax
Declaration
public const CryptographicStandard CMS
Field Value
Type |
---|
CryptographicStandard |