Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename Ccc to CccId #287

Merged
merged 1 commit into from
Jul 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/cccid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ impl CardId {

/// Cardholder Capability Container (CCC) Identifier.
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub struct Ccc(pub [u8; Self::BYTE_SIZE]);
pub struct CccId(pub [u8; Self::BYTE_SIZE]);

impl Ccc {
impl CccId {
/// CCC size in bytes
pub const BYTE_SIZE: usize = 51;

Expand Down Expand Up @@ -115,7 +115,7 @@ impl Ccc {
}
}

impl Display for Ccc {
impl Display for CccId {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(str::from_utf8(&hex::encode(&self.0[..])).unwrap())
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ mod transaction;
mod yubikey;

pub use crate::{
cccid::{CardId, Ccc},
cccid::{CardId, CccId},
certificate::Certificate,
chuid::ChuId,
config::Config,
Expand Down
2 changes: 1 addition & 1 deletion src/setting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ pub struct Setting {
}

impl Setting {
/// Get a [`SettingValue`] value by name.
/// Get a setting by name.
pub fn get(key: &str, default: bool) -> Self {
Self::from_file(key)
.or_else(|| Self::from_env(key))
Expand Down
6 changes: 3 additions & 3 deletions src/yubikey.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

use crate::{
apdu::{Apdu, Ins},
cccid::Ccc,
cccid::CccId,
chuid::ChuId,
config::Config,
error::{Error, Result},
Expand Down Expand Up @@ -275,8 +275,8 @@ impl YubiKey {
}

/// Get Cardholder Capability Container (CCC) Identifier.
pub fn cccid(&mut self) -> Result<Ccc> {
Ccc::get(self)
pub fn cccid(&mut self) -> Result<CccId> {
CccId::get(self)
}

/// Authenticate to the card using the provided management key (MGM).
Expand Down