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

    Show / Hide Table of Contents

    Certificate Class

    Namespace:
    GemBox.Spreadsheet.Security
    Assembly:
    GemBox.Spreadsheet.dll

    Represents an X.509 certificate sent to others so that they can verify your digital signature with a public key contained in the certificate.

    • C#
    • VB.NET
    public class Certificate
    Public Class Certificate
    Inheritance:
    System.Object
    Certificate
    Remarks

    GemBox.Spreadsheet doesn't use System.Security.Cryptography.X509Certificates.X509Certificate2 class to represent a certificate because System.Security.Cryptography.X509Certificates.X509Certificate2 creates a file that holds the certificate with the public key (in various locations on a hard drive) and on some operating systems and platforms that file is not deleted unless System.Security.Cryptography.X509Certificates.X509Certificate2.Reset method is called.

    Another reason why GemBox.Spreadsheet abstracts a certificate with a Certificate class instead of using System.Security.Cryptography.X509Certificates.X509Certificate2 directly is to enable different implementations of a certificate. For example, either System.Security.Cryptography.X509Certificates.X509Certificate2 implementation from .NET or Org.BouncyCastle.X509.X509Certificate implementation from Bouncy Castle could be used.

    Constructors

    Certificate(Object)

    Initializes a new instance of the Certificate class from the specified source.

    The certificate source is an instance of a System.Security.Cryptography.X509Certificates.X509Certificate2.

    • C#
    • VB.NET
    public Certificate(object source)
    Public Sub New(source As Object)
    Parameters
    source
    System.Object

    The certificate source that is an instance of a System.Security.Cryptography.X509Certificates.X509Certificate2.

    Exceptions
    System.ArgumentException

    The source parameter is not an instance of a System.Security.Cryptography.X509Certificates.X509Certificate2.

    Certificate(String)

    Initializes a new instance of the Certificate class from a file with the specified file name.

    • C#
    • VB.NET
    public Certificate(string fileName)
    Public Sub New(fileName As String)
    Parameters
    fileName
    System.String

    The name of a certificate file.

    Exceptions
    System.ArgumentNullException

    fileName is null.

    Properties

    Subject

    Gets the subject distinguished name from the certificate.

    • C#
    • VB.NET
    public string Subject { get; }
    Public ReadOnly Property Subject As String
    Property Value
    System.String

    The subject distinguished name from the certificate.

    SubjectCommonName

    Gets the value of a Common Name attribute from Subject's distinguished name.

    • C#
    • VB.NET
    public string SubjectCommonName { get; }
    Public ReadOnly Property SubjectCommonName As String
    Property Value
    System.String

    The value of a Common Name attribute from Subject's distinguished name.

    Methods

    Equals(Certificate)

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

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

    The Certificate to compare with this Certificate instance.

    Returns
    System.Boolean

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

    Equals(Object)

    Determines whether the specified System.Object is equal to this Certificate 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 Certificate instance.

    Returns
    System.Boolean

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

    Overrides
    System.Object.Equals(System.Object)

    GetHashCode()

    Returns a hash code for this Certificate instance.

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

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

    Overrides
    System.Object.GetHashCode()

    GetRawData()

    Gets the copy of raw data of a Certificate.

    • C#
    • VB.NET
    public byte[] GetRawData()
    Public Function GetRawData As Byte()
    Returns
    System.Byte[]

    The copy of raw data of the Certificate as a byte array.

    ToString()

    Returns a System.String that represents this Certificate instance.

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

    A System.String that represents this Certificate instance.

    Overrides
    System.Object.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).

    See Also

    RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.