pub enum KeyRoleRT {
Primary,
Subordinate,
Unspecified,
}Expand description
Encodes the key role at run time.
While KeyRole tracks the key’s role in the type system,
KeyRoleRT tracks the key role at run time.
When we are doing a reference conversion (e.g. by using
Key::role_as_primary), we do not change the key’s role. But,
when we are doing an owned conversion (e.g. by using
Key::role_into_primary), we do change the key’s role. The
rationale here is that the former conversion is done to allow a
reference to be given to a function expecting a certain shape of
key (e.g. to prevent excessive monomorphization), while the latter
conversion signals intent (e.g. to put a key into a
Packet::PublicKey).
This is similar to how we have KeyParts that track the presence
or absence of secret key material in the type system, yet at run
time a key may or may not actually have secret key material (with
the constraint that a key with SecretParts MUST have secret key
material).
Variants§
Primary
The key is a primary key.
Subordinate
The key is a subkey.
Unspecified
The key’s role is unspecified.