C# Class Unity.Platform.IPhone.SecurityUtils

Show file Open project: Appverse/appverse-mobile

Public Methods

Method Description
ByteArrayToString ( byte array ) : string
ValidateWebCertificates ( Object sender, System endCert, System chain, SslPolicyErrors Errors ) : bool

Validates the web certificates.

Private Methods

Method Description
CertIsSelfSigned ( X509Certificate BCCert ) : bool

Checks wether the certificate is self-signed.

CertIsValidNow ( X509Certificate BCCert ) : bool

Checks the certificate in this same date and time.

CertificateIsTheSame ( X509Certificate BCCert ) : bool

Checks the certificate is already in cache. Cache is valid for 10 minutes after first certificate successful verification.

RemoveTimedOutCertificates ( ) : void

Removes from cache the certificates which initial validation has been performed more than 10 minutes ago.

ToThumbprint ( string s ) : string

Remove spaces to match the thumbprint.

VerifyCertificateOCSP ( System chain ) : bool

Verifies the certificate chain via OCSP

VerifyFingerprint ( System endCert, String requestUri ) : bool

Verifies the certificate fingerprint against the expected one

VerifyPublicKey ( System endCert, String requestUri ) : bool

Verifies the PK fingerprint.

Method Details

ByteArrayToString() public static method

public static ByteArrayToString ( byte array ) : string
array byte
return string

ValidateWebCertificates() public static method

Validates the web certificates.
public static ValidateWebCertificates ( Object sender, System endCert, System chain, SslPolicyErrors Errors ) : bool
sender Object /// Object usually parsed as WebRequest or HttpWebRequest. ///
endCert System /// Certificate consumed in the request. ///
chain System /// Certificate chain total or partial. ///
Errors SslPolicyErrors /// Policy errors found during the chain build process. ///
return bool