pub unsafe fn ykpiv_util_set_cccid(state: *mut YubiKey, ccc: *const CCCID) -> ErrorKind {
    let mut res: ErrorKind = ErrorKind::Ok;
    let mut id = [0u8; 14];
    let mut buf = [0u8; 51];
    let len: usize;

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

    if ccc.is_null() {
        if _ykpiv_prng_generate(id.as_mut_ptr(), id.len()) != PRngErrorKind::Ok {
            return ErrorKind::RandomnessError;
        }
    } else {
        memcpy(
            id.as_mut_ptr() as (*mut c_void),
            (*ccc).0.as_ptr() as (*const c_void),
            id.len(),
        );
    }

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

    if _ykpiv_ensure_application_selected(state) == ErrorKind::Ok {
        len = 51;

        memcpy(
            buf.as_mut_ptr() as *mut c_void,
            CCC_TMPL.as_ptr() as *const c_void,
            len,
        );

        memcpy(
            buf.as_mut_ptr().offset(9) as (*mut c_void),
            id.as_mut_ptr() as (*const c_void),
            14,
        );

        res = _ykpiv_save_object(state, YKPIV_OBJ_CAPABILITY as i32, buf.as_mut_ptr(), len);
    }

    _ykpiv_end_transaction(state);
    res
}
/// Get Cardholder Capability Container (CCC) ID
Get Cardholder Capability Container (CCC) ID
Get Cardholder Capability Container ( CCC ) ID
pub unsafe fn ykpiv_util_set_cccid(state: *mut YubiKey, ccc: *const CCCID) -> ErrorKind {
    let mut res: ErrorKind = ErrorKind::Ok;
    let mut id = [0u8; 14];
    let mut buf = [0u8; 51];
    let len: usize;
    if state.is_null() {
        return ErrorKind::GenericError;
    }
    if ccc.is_null() {
        if _ykpiv_prng_generate(id.as_mut_ptr(), id.len()) != PRngErrorKind::Ok {
            return ErrorKind::RandomnessError;
        }
    } else {
        memcpy(
            id.as_mut_ptr() as (*mut c_void),
            (*ccc).0.as_ptr() as (*const c_void),
            id.len(),
        );
    }
    if _ykpiv_begin_transaction(state) != ErrorKind::Ok {
        return ErrorKind::PcscError;
    }
    if _ykpiv_ensure_application_selected(state) == ErrorKind::Ok {
        len = 51;
        memcpy(
            buf.as_mut_ptr() as *mut c_void,
            CCC_TMPL.as_ptr() as *const c_void,
            len,
        );
        memcpy(
            buf.as_mut_ptr().offset(9) as (*mut c_void),
            id.as_mut_ptr() as (*const c_void),
            14,
        );
        res = _ykpiv_save_object(state, YKPIV_OBJ_CAPABILITY as i32, buf.as_mut_ptr(), len);
    }
    _ykpiv_end_transaction(state);
    res
}
pub unsafe fn ykpiv_util_set_cccid ( state : * mut YubiKey , ccc : * const CCCID ) -> ErrorKind { let mut res : ErrorKind = ErrorKind :: Ok ; let mut id = [ 0u8 ; 14 ] ; let mut buf = [ 0u8 ; 51 ] ; let len : usize ; if state . is_null ( ) { return ErrorKind :: GenericError ; } if ccc . is_null ( ) { if _ykpiv_prng_generate ( id . as_mut_ptr ( ) , id . len ( ) ) != PRngErrorKind :: Ok { return ErrorKind :: RandomnessError ; } } else { memcpy ( id . as_mut_ptr ( ) as ( * mut c_void ) , ( * ccc ) . 0 . as_ptr ( ) as ( * const c_void ) , id . len ( ) , ) ; } if _ykpiv_begin_transaction ( state ) != ErrorKind :: Ok { return ErrorKind :: PcscError ; } if _ykpiv_ensure_application_selected ( state ) == ErrorKind :: Ok { len = 51 ; memcpy ( buf . as_mut_ptr ( ) as * mut c_void , CCC_TMPL . as_ptr ( ) as * const c_void , len , ) ; memcpy ( buf . as_mut_ptr ( ) . offset ( 9 ) as ( * mut c_void ) , id . as_mut_ptr ( ) as ( * const c_void ) , 14 , ) ; res = _ykpiv_save_object ( state , YKPIV_OBJ_CAPABILITY as i32 , buf . as_mut_ptr ( ) , len ) ; } _ykpiv_end_transaction ( state ) ; res }
Get Cardholder Capability Container (CCC) ID
Get Cardholder Capability Container ( CCC ) ID
state
*mut YubiKey
ccc
*const CCCID