pub unsafe fn ykpiv_util_get_cccid(state: *mut YubiKey, ccc: *mut CCCID) -> ErrorKind {
    let mut res: ErrorKind = ErrorKind::Ok;
    let mut buf = [0u8; CB_OBJ_MAX];
    let mut len = buf.len();

    if ccc.is_null() {
        return ErrorKind::GenericError;
    }

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

    if _ykpiv_ensure_application_selected(state) == ErrorKind::Ok {
        res = _ykpiv_fetch_object(
            state,
            YKPIV_OBJ_CAPABILITY as i32,
            buf.as_mut_ptr(),
            &mut len,
        );

        if res == ErrorKind::Ok {
            if len != CCC_TMPL.len() {
                _ykpiv_end_transaction(state);
                return ErrorKind::GenericError;
            }

            memcpy(
                (*ccc).0.as_mut_ptr() as (*mut c_void),
                buf.as_mut_ptr().offset(9) as (*const c_void),
                YKPIV_CCCID_SIZE,
            );
        }
    }

    res
}
/// Get Cardholder Capability Container (CCC) ID
Get Cardholder Capability Container (CCC) ID
Get Cardholder Capability Container ( CCC ) ID
pub unsafe fn ykpiv_util_get_cccid(state: *mut YubiKey, ccc: *mut CCCID) -> ErrorKind {
    let mut res: ErrorKind = ErrorKind::Ok;
    let mut buf = [0u8; CB_OBJ_MAX];
    let mut len = buf.len();
    if ccc.is_null() {
        return ErrorKind::GenericError;
    }
    if _ykpiv_begin_transaction(state) != ErrorKind::Ok {
        return ErrorKind::PcscError;
    }
    if _ykpiv_ensure_application_selected(state) == ErrorKind::Ok {
        res = _ykpiv_fetch_object(
            state,
            YKPIV_OBJ_CAPABILITY as i32,
            buf.as_mut_ptr(),
            &mut len,
        );
        if res == ErrorKind::Ok {
            if len != CCC_TMPL.len() {
                _ykpiv_end_transaction(state);
                return ErrorKind::GenericError;
            }
            memcpy(
                (*ccc).0.as_mut_ptr() as (*mut c_void),
                buf.as_mut_ptr().offset(9) as (*const c_void),
                YKPIV_CCCID_SIZE,
            );
        }
    }
    res
}
pub unsafe fn ykpiv_util_get_cccid ( state : * mut YubiKey , ccc : * mut CCCID ) -> ErrorKind { let mut res : ErrorKind = ErrorKind :: Ok ; let mut buf = [ 0u8 ; CB_OBJ_MAX ] ; let mut len = buf . len ( ) ; if ccc . is_null ( ) { return ErrorKind :: GenericError ; } if _ykpiv_begin_transaction ( state ) != ErrorKind :: Ok { return ErrorKind :: PcscError ; } if _ykpiv_ensure_application_selected ( state ) == ErrorKind :: Ok { res = _ykpiv_fetch_object ( state , YKPIV_OBJ_CAPABILITY as i32 , buf . as_mut_ptr ( ) , & mut len , ) ; if res == ErrorKind :: Ok { if len != CCC_TMPL . len ( ) { _ykpiv_end_transaction ( state ) ; return ErrorKind :: GenericError ; } memcpy ( ( * ccc ) . 0 . as_mut_ptr ( ) as ( * mut c_void ) , buf . as_mut_ptr ( ) . offset ( 9 ) as ( * const c_void ) , YKPIV_CCCID_SIZE , ) ; } } res }
Get Cardholder Capability Container (CCC) ID
Get Cardholder Capability Container ( CCC ) ID
state
*mut YubiKey
ccc
*mut CCCID