Posts

A collection of 55 articles

Yubico for Windows

This post records how I set up Yubico Key in Windows, so I’ll not delve into too much details. I have the model YubiKey 5 NFC. I frequently use 2 GPG keys stored in the key, one for encryption, another for SSH authentication. The GPG encryption part is simple, GnuPG just works. Using the stored GPG key for SSH is a bit complex, because it requires collaboration between GnuPG and the SSH client. After experiment many different solutions, I decide to use the simplest one, using putty/plink as the SSH client and enabling thepageant support in GnuPG.

Updated  •  2 min read

Rust Pin

Pin is an obscure type in Rust because of the naming and indirect concepts. The first indirect concept is pointer. Pin<X> does not guarantee that X will not move. If X is a pointer which target type is T, Pin<X> guarantees that T will not move. The second is “not move”. It really means that the only way to get the mut reference to T is via unsafe interface. The last is the Unpin mark trait. Pin forbids safe interface to get the mut reference to T only when T is !Unpin. In simple words, Pin is a pointer wrapper. When a pointer is trapped inside Pin, and the pointee type is !Unpin, there’s no safe way to get a mut reference to the pointee.

Updated  •  2 min read