menu

Xamarin.Android

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class KeyStorageFlags - Xamarin.Android API Reference | Syncfusion

    Show / Hide Table of Contents

    Class KeyStorageFlags

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

    Inheritance
    System.Object
    KeyStorageFlags
    Namespace: Syncfusion.Pdf.Security
    Assembly: Syncfusion.Pdf.Portable.dll
    Syntax
    public sealed class KeyStorageFlags : Enum
    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

    DefaultKeySet

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

    Declaration
    public const KeyStorageFlags DefaultKeySet
    Field Value
    Type
    KeyStorageFlags

    Exportable

    Imported keys are marked as exportable.

    Declaration
    public const KeyStorageFlags Exportable
    Field Value
    Type
    KeyStorageFlags

    MachineKeySet

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

    Declaration
    public const KeyStorageFlags MachineKeySet
    Field Value
    Type
    KeyStorageFlags

    PersistKeySet

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

    Declaration
    public const KeyStorageFlags PersistKeySet
    Field Value
    Type
    KeyStorageFlags

    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.

    Declaration
    public const KeyStorageFlags UserKeySet
    Field Value
    Type
    KeyStorageFlags

    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.

    Declaration
    public const KeyStorageFlags UserProtected
    Field Value
    Type
    KeyStorageFlags
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved