pub unsafe fn ykpiv_decrypt_data(
    state: *mut YubiKey,
    input: *const u8,
    input_len: usize,
    out: *mut u8,
    out_len: *mut usize,
    algorithm: u8,
    key: u8,
) -> ErrorKind {
    if state.is_null() {
        return ErrorKind::GenericError;
    }

    if _ykpiv_begin_transaction(state) != ErrorKind::Ok {
        return ErrorKind::PcscError;
    }

    // don't attempt to reselect in crypt operations to avoid problems with PIN_ALWAYS

    let res = _general_authenticate(state, input, input_len, out, out_len, algorithm, key, true);
    _ykpiv_end_transaction(state);
    res
}
/// Decrypt data using a PIV key
Decrypt data using a PIV key
Decrypt data using a PIV key
pub unsafe fn ykpiv_decrypt_data(
    state: *mut YubiKey,
    input: *const u8,
    input_len: usize,
    out: *mut u8,
    out_len: *mut usize,
    algorithm: u8,
    key: u8,
) -> ErrorKind {
    if state.is_null() {
        return ErrorKind::GenericError;
    }
    if _ykpiv_begin_transaction(state) != ErrorKind::Ok {
        return ErrorKind::PcscError;
    }
    // don't attempt to reselect in crypt operations to avoid problems with PIN_ALWAYS
    let res = _general_authenticate(state, input, input_len, out, out_len, algorithm, key, true);
    _ykpiv_end_transaction(state);
    res
}
pub unsafe fn ykpiv_decrypt_data ( state : * mut YubiKey , input : * const u8 , input_len : usize , out : * mut u8 , out_len : * mut usize , algorithm : u8 , key : u8 , ) -> ErrorKind { if state . is_null ( ) { return ErrorKind :: GenericError ; } if _ykpiv_begin_transaction ( state ) != ErrorKind :: Ok { return ErrorKind :: PcscError ; } // don't attempt to reselect in crypt operations to avoid problems with PIN_ALWAYS let res = _general_authenticate ( state , input , input_len , out , out_len , algorithm , key , true ) ; _ykpiv_end_transaction ( state ) ; res }
Decrypt data using a PIV key
Decrypt data using a PIV key
state
*mut YubiKey
input
*const u8
input_len
usize
out
*mut u8
out_len
*mut usize
algorithm
u8
key
u8