GemBox.Pdf
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    PdfEncryptionLevel Struct

    Namespace:
    GemBox.Pdf.Security
    Assembly:
    GemBox.Pdf.dll

    Represents a symmetric encryption algorithm used in a PDF file and the length of the encryption key used in that algorithm.

    • C#
    • VB.NET
    public struct PdfEncryptionLevel : IEquatable<PdfEncryptionLevel>
    Public Structure PdfEncryptionLevel
        Implements IEquatable(Of PdfEncryptionLevel)
    Implements
    System.IEquatable<PdfEncryptionLevel>

    Constructors

    PdfEncryptionLevel(PdfEncryptionAlgorithm, Int32)

    Initializes a new instance of the PdfEncryptionLevel structure.

    • C#
    • VB.NET
    public PdfEncryptionLevel(PdfEncryptionAlgorithm algorithm, int keyLength)
    Public Sub New(algorithm As PdfEncryptionAlgorithm, keyLength As Integer)
    Parameters
    algorithm
    PdfEncryptionAlgorithm

    The symmetric encryption algorithm.

    keyLength
    System.Int32

    The length of the encryption key (in bits) used in the algorithm.

    Fields

    AES_128

    The 128-bit AES encryption level.

    Compatible with PDF_1_6.

    • C#
    • VB.NET
    public static readonly PdfEncryptionLevel AES_128
    Public Shared ReadOnly AES_128 As PdfEncryptionLevel
    Field Value
    PdfEncryptionLevel

    AES_256

    The 256-bit AES encryption level.

    Compatible with PDF_1_7 using Adobe's extension level 8 or with PDF_2_0.

    • C#
    • VB.NET
    public static readonly PdfEncryptionLevel AES_256
    Public Shared ReadOnly AES_256 As PdfEncryptionLevel
    Field Value
    PdfEncryptionLevel

    RC4_128

    The 128-bit RC4 encryption level.

    • C#
    • VB.NET
    public static readonly PdfEncryptionLevel RC4_128
    Public Shared ReadOnly RC4_128 As PdfEncryptionLevel
    Field Value
    PdfEncryptionLevel

    RC4_40

    The 40-bit RC4 encryption level.

    • C#
    • VB.NET
    public static readonly PdfEncryptionLevel RC4_40
    Public Shared ReadOnly RC4_40 As PdfEncryptionLevel
    Field Value
    PdfEncryptionLevel

    Properties

    Algorithm

    Gets the symmetric encryption algorithm.

    • C#
    • VB.NET
    public readonly PdfEncryptionAlgorithm Algorithm { get; }
    Public ReadOnly Property Algorithm As PdfEncryptionAlgorithm
    Property Value
    PdfEncryptionAlgorithm

    The symmetric encryption algorithm.

    KeyLength

    Gets the length of the encryption key (in bits) used in the Algorithm.

    • C#
    • VB.NET
    public readonly int KeyLength { get; }
    Public ReadOnly Property KeyLength As Integer
    Property Value
    System.Int32

    The length of the encryption key (in bits) used in the Algorithm.

    Methods

    Equals(PdfEncryptionLevel)

    Determines whether the specified PdfEncryptionLevel is equal to this PdfEncryptionLevel instance.

    • C#
    • VB.NET
    public bool Equals(PdfEncryptionLevel other)
    Public Function Equals(other As PdfEncryptionLevel) As Boolean
    Parameters
    other
    PdfEncryptionLevel

    The PdfEncryptionLevel to compare with this PdfEncryptionLevel instance.

    Returns
    System.Boolean

    true if the specified PdfEncryptionLevel is equal to this PdfEncryptionLevel instance; otherwise, false.

    Equals(Object)

    Determines whether the specified System.Object is equal to this PdfEncryptionLevel instance.

    • C#
    • VB.NET
    public override bool Equals(object obj)
    Public Overrides Function Equals(obj As Object) As Boolean
    Parameters
    obj
    System.Object

    The System.Object to compare with this PdfEncryptionLevel instance.

    Returns
    System.Boolean

    true if the specified System.Object is equal to this PdfEncryptionLevel instance; otherwise, false.

    Overrides
    System.ValueType.Equals(System.Object)

    GetHashCode()

    Returns a hash code for this PdfEncryptionLevel instance.

    • C#
    • VB.NET
    public override int GetHashCode()
    Public Overrides Function GetHashCode As Integer
    Returns
    System.Int32

    A hash code for this PdfEncryptionLevel instance, suitable for use in hashing algorithms and data structures like a hash table.

    Overrides
    System.ValueType.GetHashCode()

    ToString()

    Returns a System.String that represents this PdfEncryptionLevel instance.

    • C#
    • VB.NET
    public override string ToString()
    Public Overrides Function ToString As String
    Returns
    System.String

    A System.String that represents this PdfEncryptionLevel instance.

    Overrides
    System.ValueType.ToString()
    Remarks

    This method should be used primarily for debugging purposes and should be considered volatile (format of its return value might change in future versions).

    Operators

    Equality(PdfEncryptionLevel, PdfEncryptionLevel)

    Determines whether first and second PdfEncryptionLevels are equal.

    • C#
    • VB.NET
    public static bool operator ==(PdfEncryptionLevel first, PdfEncryptionLevel second)
    Public Shared Operator =(first As PdfEncryptionLevel, second As PdfEncryptionLevel) As Boolean
    Parameters
    first
    PdfEncryptionLevel

    The first PDF encryption level.

    second
    PdfEncryptionLevel

    The second PDF encryption level.

    Returns
    System.Boolean

    true if first and second PDF encryption levels are equal; otherwise, false.

    Inequality(PdfEncryptionLevel, PdfEncryptionLevel)

    Determines whether first and second PdfEncryptionLevels are not equal.

    • C#
    • VB.NET
    public static bool operator !=(PdfEncryptionLevel first, PdfEncryptionLevel second)
    Public Shared Operator <>(first As PdfEncryptionLevel, second As PdfEncryptionLevel) As Boolean
    Parameters
    first
    PdfEncryptionLevel

    The first PDF encryption level.

    second
    PdfEncryptionLevel

    The second PDF encryption level.

    Returns
    System.Boolean

    true if first and second PDF encryption levels are not equal; otherwise, false.

    Implements

    System.IEquatable<T>

    Examples

    Encryption settings example

    See Also

    PDF Specification ISO 32000-1:2008, section '7.6 Encryption'
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.