當前位置: 首頁>>代碼示例>>Java>>正文


Java PassportService.getInputStream方法代碼示例

本文整理匯總了Java中org.jmrtd.PassportService.getInputStream方法的典型用法代碼示例。如果您正苦於以下問題:Java PassportService.getInputStream方法的具體用法?Java PassportService.getInputStream怎麽用?Java PassportService.getInputStream使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.jmrtd.PassportService的用法示例。


在下文中一共展示了PassportService.getInputStream方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: signData

import org.jmrtd.PassportService; //導入方法依賴的package包/類
/**
 * Signs 8 bytes by the passport using the AA functionality.
 *
 * @return byte[] - signed byte array
 */
public byte[] signData(PassportService ps, byte[] data) throws Exception{
    InputStream is15 = null;
    try {
        is15 = ps.getInputStream(PassportService.EF_DG15);
        // doAA of JMRTD library only returns signed data, and does not have the AA functionality yet
        // there is no need for sending public key information with the method.
        return ps.doAA(null, null, null, data);
    } catch (Exception ex) {
        ex.printStackTrace();
        throw ex;
    } finally {
        if (is15 != null)
            is15.close();
    }
}
 
開發者ID:digital-voting-pass,項目名稱:polling-station-app,代碼行數:21,代碼來源:PassportConnection.java

示例2: getVoter

import org.jmrtd.PassportService; //導入方法依賴的package包/類
/**
 * Get personal information about a voter from datagroup1.
 * @return Voter - Voter object containing personal data.
 */
public Voter getVoter(PassportService ps) throws Exception {
    InputStream is = null;
    try {
        is = ps.getInputStream(PassportService.EF_DG1);
        DG1File dg1 = (DG1File) LDSFileUtil.getLDSFile(PassportService.EF_DG1, is);
        MRZInfo mrzInfo = dg1.getMRZInfo();
        //Replace '<' with spaces since JMRTD does not remove these.
        return new Voter(mrzInfo.getSecondaryIdentifier().replaceAll("<", " ").trim(),
                mrzInfo.getPrimaryIdentifier().replaceAll("<", " ").trim(),
                mrzInfo.getGender());
    } catch (Exception ex) {
        ex.printStackTrace();
        throw ex;
    } finally {
        if (is != null)
            is.close();
    }
}
 
開發者ID:digital-voting-pass,項目名稱:polling-station-app,代碼行數:23,代碼來源:PassportConnection.java

示例3: getAAPublicKey

import org.jmrtd.PassportService; //導入方法依賴的package包/類
/**
 * Retrieves the public key used for Active Authentication from datagroup 15.
 *
 * @return Publickey - returns the publickey used for AA
 */
public PublicKey getAAPublicKey(PassportService ps) throws Exception{
    InputStream is15 = null;
    try {
        is15 = ps.getInputStream(PassportService.EF_DG15);
        DG15File dg15 = new DG15File(is15);
        return dg15.getPublicKey();
    } catch (Exception ex) {
        ex.printStackTrace();
        throw ex;
    } finally {
        if (is15 != null)
            is15.close();
    }
}
 
開發者ID:digital-voting-pass,項目名稱:polling-station-app,代碼行數:20,代碼來源:PassportConnection.java


注:本文中的org.jmrtd.PassportService.getInputStream方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。