[]
        
(Showing Draft Content)

GrapeCity.Documents.Pdf.Security.SecurityUtils

Class SecurityUtils

Namespace
GrapeCity.Documents.Pdf.Security
Assembly
GcDocs.Pdf.dll

The security utility class.

public static class SecurityUtils
Inheritance
object
SecurityUtils
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()

Methods

GetCertificateChain(byte[], string, X509RevocationMode, X509VerificationFlags)

Builds the chain of certificates from a byte array.

public static X509Certificate2[] GetCertificateChain(byte[] rawData, string password, X509RevocationMode revocationMode = X509RevocationMode.NoCheck, X509VerificationFlags verificationFlags = X509VerificationFlags.AllFlags)

Parameters

rawData byte[]

The byte array containing data in PFX or P12 format.

password string

The password to use.

revocationMode System.Security.Cryptography.X509Certificates.X509RevocationMode

The revocation mode used to build the X509Chain.

verificationFlags System.Security.Cryptography.X509Certificates.X509VerificationFlags

The verification flags used to build the X509Chain.

Returns

System.Security.Cryptography.X509Certificates.X509Certificate2[]

The chain of certificates. The first element is the signing certificate, the last element is the certificate of CA.

GetCertificateChain(string, string, X509RevocationMode, X509VerificationFlags)

Builds the chain of certificates from a specified file.

public static X509Certificate2[] GetCertificateChain(string fileName, string password, X509RevocationMode revocationMode = X509RevocationMode.NoCheck, X509VerificationFlags verificationFlags = X509VerificationFlags.AllFlags)

Parameters

fileName string

The name of a .pfx or a .p12 file.

password string

The password to use.

revocationMode System.Security.Cryptography.X509Certificates.X509RevocationMode

The revocation mode used to build the X509Chain.

verificationFlags System.Security.Cryptography.X509Certificates.X509VerificationFlags

The verification flags used to build the X509Chain.

Returns

System.Security.Cryptography.X509Certificates.X509Certificate2[]

The chain of certificates. The first element is the signing certificate, the last element is the certificate of CA.

GetCRL(Uri)

Downloads the CRL from a specified URL.

public static byte[] GetCRL(Uri uri)

Parameters

uri System.Uri

The target URL.

Returns

byte[]

The CRL or null if the CRL could not be obtained from the specified URL.

GetCRLURL(X509Certificate2)

Returns the URL of the Certificate Revocation List(CRL) for a certificate.

public static string GetCRLURL(X509Certificate2 certificate)

Parameters

certificate System.Security.Cryptography.X509Certificates.X509Certificate2

Returns

string

GetOCSP(X509Certificate2, X509Certificate2, string)

Returns the OCSP for specified certificate.

public static byte[] GetOCSP(X509Certificate2 certificate, X509Certificate2 parentCertificate, string url)

Parameters

certificate System.Security.Cryptography.X509Certificates.X509Certificate2

The certificate to check.

parentCertificate System.Security.Cryptography.X509Certificates.X509Certificate2

The parent certificate.

url string

The OCSP URL, can be null, in this case it will be obtained from certificate if possible.

Returns

byte[]

GetOCSPURL(X509Certificate2)

Returns the OCSP URL from the certificate.

public static string GetOCSPURL(X509Certificate2 certificate)

Parameters

certificate System.Security.Cryptography.X509Certificates.X509Certificate2

Returns

string