Exemple #1
0
        internal static CertificateVerificationEventArgs FromNativeObject(
            AGDnsApi.ag_certificate_verification_event coreArgsС)
        {
            byte[]        certBytes = MarshalUtils.AgBufferToBytes(coreArgsС.pCertificate);
            List <byte[]> chain     = MarshalUtils.AgListToList <AGDnsApi.ag_buffer, byte[]>(
                coreArgsС.chain,
                MarshalUtils.AgBufferToBytes);
            CertificateVerificationEventArgs eventArgs = new CertificateVerificationEventArgs
            {
                Certificate = certBytes,
                Chain       = chain
            };

            return(eventArgs);
        }
        internal static DnsStamp FromNativeObject(AGDnsApi.ag_dns_stamp agDnsStampC)
        {
            byte[]        publicKey = MarshalUtils.AgBufferToBytes(agDnsStampC.server_public_key);
            List <byte[]> hashes    = MarshalUtils.AgListToList <MarshalUtils.ag_buffer, byte[]>(
                agDnsStampC.hashes,
                MarshalUtils.AgBufferToBytes);
            DnsStamp dnsStamp = new DnsStamp
            {
                PublicKey = publicKey,
                Hashes    = hashes
            };

            MarshalUtils.AllPtrsToStrings(agDnsStampC, dnsStamp);
            MarshalUtils.CopyFieldsToProperties(agDnsStampC, dnsStamp);
            return(dnsStamp);
        }