pub unsafe fn ykpiv_get_version(state: *mut YubiKey) -> Result<String, ErrorKind> {
    let mut ver: Version = Version {
        major: 0u8,
        minor: 0u8,
        patch: 0u8,
    };

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

    if _ykpiv_ensure_application_selected(state) == ErrorKind::Ok {
        let res = _ykpiv_get_version(state, &mut ver);

        if res == ErrorKind::Ok {
            _ykpiv_end_transaction(state);
            return Ok(format!("{}.{}.{}", ver.major, ver.minor, ver.patch));
        }
    }

    _ykpiv_end_transaction(state);
    Err(ErrorKind::GenericError)
}
/// Get the YubiKey's PIV application version as a string
Get the YubiKey's PIV application version as a string
Get the YubiKey ' s PIV application version as a string
pub unsafe fn ykpiv_get_version(state: *mut YubiKey) -> Result<String, ErrorKind> {
    let mut ver: Version = Version {
        major: 0u8,
        minor: 0u8,
        patch: 0u8,
    };
    if _ykpiv_begin_transaction(state) != ErrorKind::Ok {
        return Err(ErrorKind::PcscError);
    }
    if _ykpiv_ensure_application_selected(state) == ErrorKind::Ok {
        let res = _ykpiv_get_version(state, &mut ver);
        if res == ErrorKind::Ok {
            _ykpiv_end_transaction(state);
            return Ok(format!("{}.{}.{}", ver.major, ver.minor, ver.patch));
        }
    }
    _ykpiv_end_transaction(state);
    Err(ErrorKind::GenericError)
}
pub unsafe fn ykpiv_get_version ( state : * mut YubiKey ) -> Result < String , ErrorKind > { let mut ver : Version = Version { major : 0u8 , minor : 0u8 , patch : 0u8 , } ; if _ykpiv_begin_transaction ( state ) != ErrorKind :: Ok { return Err ( ErrorKind :: PcscError ) ; } if _ykpiv_ensure_application_selected ( state ) == ErrorKind :: Ok { let res = _ykpiv_get_version ( state , & mut ver ) ; if res == ErrorKind :: Ok { _ykpiv_end_transaction ( state ) ; return Ok ( format ! ( " " ver major ver minor ver patch ) ) ; } } _ykpiv_end_transaction ( state ) ; Err ( ErrorKind :: GenericError ) }
Get the YubiKey's PIV application version as a string
Get the YubiKey ' s PIV application version as a string
state
*mut YubiKey