Skip to main content

PivSlot

Enum PivSlot 

Source
pub enum PivSlot {
    Authentication,
    Signature,
    KeyManagement,
    CardAuthentication,
    Retired(u8),
}
Expand description

PIV key slot identifiers.

Defined by NIST SP 800-73-5 Part 1, Table 4b (“PIV Card Application Card Command Interface: Key References”). These slot assignments are fixed by the standard and MUST NOT be changed.

§Standard references

  • NIST SP 800-73-5 Part 1, §3.1.2: Key References
  • NIST SP 800-73-5 Part 2, §3.2: GENERAL AUTHENTICATE

Variants§

§

Authentication

Slot 9A: PIV Authentication Key. Used for card/cardholder authentication (e.g. system login). PIN required once per session. [NIST SP 800-73-5 Part 1, §3.1.2]

§

Signature

Slot 9C: Digital Signature Key. Used for document/code signing. PIN required before EVERY private key operation (“PIN Always” access rule). Data to be signed is hashed off-card. [NIST SP 800-73-5 Part 1, §3.1.2; Part 2, §3.2.4]

§

KeyManagement

Slot 9D: Key Management Key. Used for key establishment (encryption/decryption). PIN required once per session. [NIST SP 800-73-5 Part 1, §3.1.2]

§

CardAuthentication

Slot 9E: Card Authentication Key. Used for physical access (e.g. PIV-enabled door locks). NO PIN required for private key operations. [NIST SP 800-73-5 Part 1, §3.1.2]

§

Retired(u8)

Retired Key Management Key slot.

Holds a previously used Key Management key for decrypting historical documents. The inner value is an index in 0..=19, where 0 corresponds to PIV key reference 0x82 and 19 corresponds to 0x95.

Construct with PivSlot::retired to enforce the valid range. [NIST SP 800-73-5 Part 1, §3.1.2]

Implementations§

Source§

impl PivSlot

Source

pub fn retired(index: u8) -> Option<Self>

Create a retired key management slot from an index in 0..=19.

Returns None if index is out of the valid range. The 20 retired slots correspond to PIV key references 0x82–0x95.

Trait Implementations§

Source§

impl Clone for PivSlot

Source§

fn clone(&self) -> PivSlot

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for PivSlot

Source§

impl Debug for PivSlot

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for PivSlot

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for PivSlot

Source§

impl Hash for PivSlot

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for PivSlot

Source§

fn eq(&self, other: &PivSlot) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for PivSlot

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for PivSlot

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.