menu

WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Enum KeyStorageFlags - WPF API Reference | Syncfusion

    Show / Hide Table of Contents

    Enum KeyStorageFlags

    Represents where and how to import private key of the certificate.

    Namespace: Syncfusion.Pdf.Security
    Assembly: Syncfusion.Pdf.Base.dll
    Syntax
    public enum KeyStorageFlags
    Examples
    // Creates a new document
    PdfDocument doc = new PdfDocument();
    //Creates a new page and adds it as the last page of the document
    PdfPage page = doc.Pages.Add();
    PdfCertificate pdfCert = new PdfCertificate(certificateStream, "123",KeyStorageFlags.DefaultKeySet);
    PdfSignature signature = new PdfSignature(doc, page, pdfCert, "Signature");
    signature.Bounds = new RectangleF(new PointF(5, 5),new SizeF(100,200));            
    doc.Save("SignedPdfSample.pdf");
    doc.Close(true);
    ' Creates a new document
    Dim doc As PdfDocument = New PdfDocument()
    ' Create a page
    Dim page As PdfPage = doc.Pages.Add()
    Dim pdfCert As PdfCertificate = New PdfCertificate(certificateStream, "123",KeyStorageFlags.DefaultKeySet)
    Dim signature As PdfSignature = New PdfSignature(doc, page, pdfCert, "Signature")
    signature.Bounds = New RectangleF(New PointF(5, 5),New SizeF(100,200))
    doc.Save("SignedPdfSample.pdf")
    doc.Close(True)

    Fields

    Name Description
    DefaultKeySet

    The default key set is used. The user key set is usually the default.

    Exportable

    Imported keys are marked as exportable.

    MachineKeySet

    Private keys are stored in the local computer store rather than the current user store.

    PersistKeySet

    The key associated with a PFX file is persisted when importing a certificate.

    UserKeySet

    Private keys are stored in the current user store rather than the local computer store. This occurs even if the certificate specifies that the keys should go in the local computer store.

    UserProtected

    Notify the user through a dialog box or other method that the key is accessed. The Cryptographic Service Provider (CSP) in use defines the precise behavior.

    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved