internal void UpdateFromMem(IntPtr keyPtr) { var key = (_gpgme_key)Marshal.PtrToStructure(keyPtr, typeof(_gpgme_key)); _key_ptr = keyPtr; Revoked = key.revoked; Expired = key.expired; Disabled = key.disabled; Invalid = key.invalid; CanEncrypt = key.can_encrypt; CanSign = key.can_sign; CanCertify = key.can_certify; CanAuthenticate = key.can_authenticate; IsQualified = key.is_qualified; Secret = key.secret; Protocol = (Protocol)key.protocol; OwnerTrust = (Validity)key.owner_trust; KeylistMode = (KeylistMode)key.keylist_mode; IssuerName = Gpgme.PtrToStringUTF8(key.issuer_name); IssuerSerial = Gpgme.PtrToStringAnsi(key.issuer_serial); ChainId = Gpgme.PtrToStringAnsi(key.chain_id); if (key.subkeys != IntPtr.Zero) { Subkeys = new Subkey(key.subkeys); } if (key.uids != IntPtr.Zero) { Uids = new UserId(key.uids); } }
internal void UpdateFromMem(IntPtr keyPtr) { _gpgme_key key = (_gpgme_key) Marshal.PtrToStructure(keyPtr, typeof(_gpgme_key)); this.keyPtr = keyPtr; revoked = key.revoked; expired = key.expired; disabled = key.disabled; invalid = key.invalid; can_encrypt = key.can_encrypt; can_sign = key.can_sign; can_certify = key.can_certify; can_authenticate = key.can_authenticate; is_qualified = key.is_qualified; secret = key.secret; protocol = (Protocol)key.protocol; owner_trust = (Validity)key.owner_trust; keylistmode = (KeylistMode)key.keylist_mode; issuer_name = Gpgme.PtrToStringUTF8(key.issuer_name); issuer_serial = Gpgme.PtrToStringAnsi(key.issuer_serial); chain_id = Gpgme.PtrToStringAnsi(key.chain_id); if (key.subkeys != (IntPtr)0) { subkeys = new Subkey(key.subkeys); } if (key.uids != (IntPtr)0) { uids = new UserId(key.uids); } }