menu

UWP

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class CryptographicStandard - UWP API Reference | Syncfusion

    Show / Hide Table of Contents

    Class CryptographicStandard

    Specifies the cryptographic standard.

    Inheritance
    System.Object
    CryptographicStandard
    Namespace: Syncfusion.Pdf.Security
    Assembly: Syncfusion.Pdf.UWP.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 = "[email protected]";
    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 = "[email protected]"
    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

    Extension Methods

    DateTimeExtension.ToDateTime(Object)
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved