Struct yubihsm::capabilities::Capabilities
[−]
pub struct Capabilities { /* fields omitted */ }
Object attributes specifying which operations are allowed to be performed
https://developers.yubico.com/YubiHSM2/Concepts/Capability.html
Methods
impl Capabilities
pub const ASYMMETRIC_DECRYPT_ECDH: Capabilities
ASYMMETRIC_DECRYPT_ECDH: Capabilities = Capabilities{bits: 2048,}
asymmetric_decrypt_ecdh: perform ECDH operation
pub const ASYMMETRIC_DECRYPT_OAEP: Capabilities
ASYMMETRIC_DECRYPT_OAEP: Capabilities = Capabilities{bits: 1024,}
asymmetric_decrypt_oaep: perform RSA-OAEP decryption
pub const ASYMMETRIC_DECRYPT_PKCS: Capabilities
ASYMMETRIC_DECRYPT_PKCS: Capabilities = Capabilities{bits: 512,}
asymmetric_decrypt_pkcs: perform RSA-PKCS1v1.5 decryption
pub const ASYMMETRIC_GEN: Capabilities
ASYMMETRIC_GEN: Capabilities = Capabilities{bits: 16,}
asymmetric_gen: generate asymmetric objects
pub const ASYMMETRIC_SIGN_ECDSA: Capabilities
ASYMMETRIC_SIGN_ECDSA: Capabilities = Capabilities{bits: 128,}
asymmetric_sign_ecdsa: compute ECDSA digital signature
pub const ASYMMETRIC_SIGN_EDDSA: Capabilities
ASYMMETRIC_SIGN_EDDSA: Capabilities = Capabilities{bits: 256,}
asymmetric_sign_eddsa: compute EdDSA (i.e. Ed25519) digital signature
pub const ASYMMETRIC_SIGN_PKCS: Capabilities
ASYMMETRIC_SIGN_PKCS: Capabilities = Capabilities{bits: 32,}
asymmetric_sign_pkcs: compute RSA-PKCS1v1.5 digital signature
pub const ASYMMETRIC_SIGN_PSS: Capabilities
ASYMMETRIC_SIGN_PSS: Capabilities = Capabilities{bits: 64,}
asymmetric_sign_pss: compute RSA-PSS digital signature
pub const ATTEST: Capabilities
ATTEST: Capabilities = Capabilities{bits: 17179869184,}
attest: create attestation (i.e. X.509 certificate) about an asymmetric object
pub const AUDIT: Capabilities
AUDIT: Capabilities = Capabilities{bits: 16777216,}
audit: read the log store
pub const DELETE_ASYMMETRIC: Capabilities
DELETE_ASYMMETRIC: Capabilities = Capabilities{bits: 2199023255552,}
delete_asymmetric: delete asymmetric key objects
pub const DELETE_AUTHKEY: Capabilities
DELETE_AUTHKEY: Capabilities = Capabilities{bits: 1099511627776,}
delete_authkey: delete AuthKey objects
pub const DELETE_HMACKEY: Capabilities
DELETE_HMACKEY: Capabilities = Capabilities{bits: 8796093022208,}
delete_hmac_key: delete HMACKey objects
pub const DELETE_OPAQUE: Capabilities
DELETE_OPAQUE: Capabilities = Capabilities{bits: 549755813888,}
delete_opaque: delete opaque objects
pub const DELETE_OTP_AEAD_KEY: Capabilities
DELETE_OTP_AEAD_KEY: Capabilities = Capabilities{bits: 35184372088832,}
delete_otp_aead_key: delete OTPAEADKey objects
pub const DELETE_TEMPLATE: Capabilities
DELETE_TEMPLATE: Capabilities = Capabilities{bits: 17592186044416,}
delete_template: delete template objects
pub const DELETE_WRAPKEY: Capabilities
DELETE_WRAPKEY: Capabilities = Capabilities{bits: 4398046511104,}
delete_wrap_key: delete WrapKey objects
pub const EXPORT_UNDER_WRAP: Capabilities
EXPORT_UNDER_WRAP: Capabilities = Capabilities{bits: 65536,}
export_under_wrap: mark an object as exportable under keywrap
pub const EXPORT_WRAPPED: Capabilities
EXPORT_WRAPPED: Capabilities = Capabilities{bits: 4096,}
export_wrapped: export objects under keywrap
pub const GENERATE_OTP_AEAD_KEY: Capabilities
GENERATE_OTP_AEAD_KEY: Capabilities = Capabilities{bits: 68719476736,}
generate_otp_aead_key: generate OTPAEADKey objects
pub const GENERATE_WRAPKEY: Capabilities
GENERATE_WRAPKEY: Capabilities = Capabilities{bits: 32768,}
generate_wrapkey: generate wrapkey objects
pub const GET_OPAQUE: Capabilities
GET_OPAQUE: Capabilities = Capabilities{bits: 1,}
get_opaque: read opaque objects
pub const GET_OPTION: Capabilities
GET_OPTION: Capabilities = Capabilities{bits: 262144,}
get_option: read device-global options
pub const GET_RANDOMNESS: Capabilities
GET_RANDOMNESS: Capabilities = Capabilities{bits: 524288,}
get_randomness: extract random bytes
pub const GET_TEMPLATE: Capabilities
GET_TEMPLATE: Capabilities = Capabilities{bits: 67108864,}
get_template: read template objects
pub const HMACKEY_GENERATE: Capabilities
HMACKEY_GENERATE: Capabilities = Capabilities{bits: 2097152,}
hmackey_generate: generate HMACKey objects
pub const HMAC_DATA: Capabilities
HMAC_DATA: Capabilities = Capabilities{bits: 4194304,}
hmac_data: compute HMAC for data
pub const HMAC_VERIFY: Capabilities
HMAC_VERIFY: Capabilities = Capabilities{bits: 8388608,}
hmac_verify: verify HMAC for data
pub const IMPORT_WRAPPED: Capabilities
IMPORT_WRAPPED: Capabilities = Capabilities{bits: 8192,}
import_wrapped: import keywrapped objects
pub const OTP_AEAD_CREATE: Capabilities
OTP_AEAD_CREATE: Capabilities = Capabilities{bits: 1073741824,}
otp_aead_create: create an OTP AEAD
pub const OTP_AEAD_RANDOM: Capabilities
OTP_AEAD_RANDOM: Capabilities = Capabilities{bits: 2147483648,}
otp_aead_random: create an OTP AEAD from random data
pub const OTP_AEAD_REWRAP_FROM: Capabilities
OTP_AEAD_REWRAP_FROM: Capabilities = Capabilities{bits: 4294967296,}
otp_aead_rewrap_from: rewrap AEADs from one OTPAEADKey Object to another
pub const OTP_AEAD_REWRAP_TO: Capabilities
OTP_AEAD_REWRAP_TO: Capabilities = Capabilities{bits: 8589934592,}
otp_aead_rewrap_to: rewrap AEADs to one OTPAEADKey Object from another
pub const OTP_DECRYPT: Capabilities
OTP_DECRYPT: Capabilities = Capabilities{bits: 536870912,}
otp_decrypt: decrypt OTP
pub const PUT_ASYMMETRIC: Capabilities
PUT_ASYMMETRIC: Capabilities = Capabilities{bits: 8,}
put_asymmetric: write asymmetric objects
pub const PUT_AUTHKEY: Capabilities
PUT_AUTHKEY: Capabilities = Capabilities{bits: 4,}
put_authkey: write AuthKey objects
pub const PUT_HMACKEY: Capabilities
PUT_HMACKEY: Capabilities = Capabilities{bits: 1048576,}
put_hmackey: write HMACKey objects
pub const PUT_OPAQUE: Capabilities
PUT_OPAQUE: Capabilities = Capabilities{bits: 2,}
put_opaque: Write Opaque Objects
pub const PUT_OPTION: Capabilities
PUT_OPTION: Capabilities = Capabilities{bits: 131072,}
put_option: write device-global options
pub const PUT_OTP_AEAD_KEY: Capabilities
PUT_OTP_AEAD_KEY: Capabilities = Capabilities{bits: 34359738368,}
put_otp_aead_key: write OTPAEADKey objects
pub const PUT_TEMPLATE: Capabilities
PUT_TEMPLATE: Capabilities = Capabilities{bits: 134217728,}
put_template: write template objects
pub const PUT_WRAPKEY: Capabilities
PUT_WRAPKEY: Capabilities = Capabilities{bits: 16384,}
put_wrapkey: write WrapKey objects
pub const RESET: Capabilities
RESET: Capabilities = Capabilities{bits: 268435456,}
reset: factory reset the device
pub const SSH_CERTIFY: Capabilities
SSH_CERTIFY: Capabilities = Capabilities{bits: 33554432,}
ssh_certify: sign SSH certificates
pub const UNWRAP_DATA: Capabilities
UNWRAP_DATA: Capabilities = Capabilities{bits: 274877906944,}
unwrap_data: unwrap user-provided data
pub const WRAP_DATA: Capabilities
WRAP_DATA: Capabilities = Capabilities{bits: 137438953472,}
wrap_data: wrap user-provided data
pub fn empty() -> Capabilities
Returns an empty set of flags.
pub fn all() -> Capabilities
Returns the set containing all flags.
pub fn bits(&self) -> u64
Returns the raw value of the flags currently stored.
pub fn from_bits(bits: u64) -> Option<Capabilities>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
pub fn from_bits_truncate(bits: u64) -> Capabilities
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
pub fn is_empty(&self) -> bool
Returns true
if no flags are currently stored.
pub fn is_all(&self) -> bool
Returns true
if all flags are currently set.
pub fn intersects(&self, other: Capabilities) -> bool
Returns true
if there are flags common to both self
and other
.
pub fn contains(&self, other: Capabilities) -> bool
Returns true
all of the flags in other
are contained within self
.
pub fn insert(&mut self, other: Capabilities)
Inserts the specified flags in-place.
pub fn remove(&mut self, other: Capabilities)
Removes the specified flags in-place.
pub fn toggle(&mut self, other: Capabilities)
Toggles the specified flags in-place.
pub fn set(&mut self, other: Capabilities, value: bool)
Inserts or removes the specified flags depending on the passed value.
Trait Implementations
impl Copy for Capabilities
impl PartialEq for Capabilities
fn eq(&self, __arg_0: &Capabilities) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Capabilities) -> bool
This method tests for !=
.
impl Eq for Capabilities
impl Clone for Capabilities
fn clone(&self) -> Capabilities
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialOrd for Capabilities
fn partial_cmp(&self, __arg_0: &Capabilities) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &Capabilities) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &Capabilities) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &Capabilities) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &Capabilities) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for Capabilities
fn cmp(&self, __arg_0: &Capabilities) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
impl Hash for Capabilities
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Debug for Capabilities
impl Binary for Capabilities
impl Octal for Capabilities
impl LowerHex for Capabilities
impl UpperHex for Capabilities
impl BitOr for Capabilities
type Output = Capabilities
The resulting type after applying the |
operator.
fn bitor(self, other: Capabilities) -> Capabilities
Returns the union of the two sets of flags.
impl BitOrAssign for Capabilities
fn bitor_assign(&mut self, other: Capabilities)
Adds the set of flags.
impl BitXor for Capabilities
type Output = Capabilities
The resulting type after applying the ^
operator.
fn bitxor(self, other: Capabilities) -> Capabilities
Returns the left flags, but with all the right flags toggled.
impl BitXorAssign for Capabilities
fn bitxor_assign(&mut self, other: Capabilities)
Toggles the set of flags.
impl BitAnd for Capabilities
type Output = Capabilities
The resulting type after applying the &
operator.
fn bitand(self, other: Capabilities) -> Capabilities
Returns the intersection between the two sets of flags.
impl BitAndAssign for Capabilities
fn bitand_assign(&mut self, other: Capabilities)
Disables all flags disabled in the set.
impl Sub for Capabilities
type Output = Capabilities
The resulting type after applying the -
operator.
fn sub(self, other: Capabilities) -> Capabilities
Returns the set difference of the two sets of flags.
impl SubAssign for Capabilities
fn sub_assign(&mut self, other: Capabilities)
Disables all flags enabled in the set.
impl Not for Capabilities
type Output = Capabilities
The resulting type after applying the !
operator.
fn not(self) -> Capabilities
Returns the complement of this set of flags.
impl Extend<Capabilities> for Capabilities
fn extend<T: IntoIterator<Item = Capabilities>>(&mut self, iterator: T)
Extends a collection with the contents of an iterator. Read more
impl FromIterator<Capabilities> for Capabilities
fn from_iter<T: IntoIterator<Item = Capabilities>>(iterator: T) -> Capabilities
Creates a value from an iterator. Read more
impl Default for Capabilities
[src]
impl Serialize for Capabilities
[src]
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer,
[src]
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<'de> Deserialize<'de> for Capabilities
[src]
fn deserialize<D>(deserializer: D) -> Result<Capabilities, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more