当前位置: 首页>>代码示例>>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;未经允许,请勿转载。