• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java KeyFingerPrintCalculator类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.bouncycastle.openpgp.operator.KeyFingerPrintCalculator的典型用法代码示例。如果您正苦于以下问题:Java KeyFingerPrintCalculator类的具体用法?Java KeyFingerPrintCalculator怎么用?Java KeyFingerPrintCalculator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



KeyFingerPrintCalculator类属于org.bouncycastle.openpgp.operator包,在下文中一共展示了KeyFingerPrintCalculator类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: PGPPublicKeyRingCollection

import org.bouncycastle.openpgp.operator.KeyFingerPrintCalculator; //导入依赖的package包/类
/**
 * Build a PGPPublicKeyRingCollection from the passed in input stream.
 *
 * @param in  input stream containing data
 * @throws IOException if a problem parsing the base stream occurs
 * @throws PGPException if an object is encountered which isn't a PGPPublicKeyRing
 */
public PGPPublicKeyRingCollection(
    InputStream    in,
    KeyFingerPrintCalculator fingerPrintCalculator)
    throws IOException, PGPException
{
    PGPObjectFactory    pgpFact = new PGPObjectFactory(in, fingerPrintCalculator);
    Object              obj;

    while ((obj = pgpFact.nextObject()) != null)
    {
        if (!(obj instanceof PGPPublicKeyRing))
        {
            throw new PGPException(obj.getClass().getName() + " found where PGPPublicKeyRing expected");
        }
        
        PGPPublicKeyRing    pgpPub = (PGPPublicKeyRing)obj;
        Long    key = new Long(pgpPub.getPublicKey().getKeyID());
        
        pubRings.put(key, pgpPub);
        order.add(key);
    }
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:30,代码来源:PGPPublicKeyRingCollection.java


示例2: PGPSecretKeyRingCollection

import org.bouncycastle.openpgp.operator.KeyFingerPrintCalculator; //导入依赖的package包/类
/**
 * Build a PGPSecretKeyRingCollection from the passed in input stream.
 *
 * @param in  input stream containing data
 * @throws IOException if a problem parsinh the base stream occurs
 * @throws PGPException if an object is encountered which isn't a PGPSecretKeyRing
 */
public PGPSecretKeyRingCollection(
    InputStream    in,
    KeyFingerPrintCalculator fingerPrintCalculator)
    throws IOException, PGPException
{
    PGPObjectFactory    pgpFact = new PGPObjectFactory(in, fingerPrintCalculator);
    Object              obj;

    while ((obj = pgpFact.nextObject()) != null)
    {
        if (!(obj instanceof PGPSecretKeyRing))
        {
            throw new PGPException(obj.getClass().getName() + " found where PGPSecretKeyRing expected");
        }
        
        PGPSecretKeyRing    pgpSecret = (PGPSecretKeyRing)obj;
        Long                key = new Long(pgpSecret.getPublicKey().getKeyID());
        
        secretRings.put(key, pgpSecret);
        order.add(key);
    }
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:30,代码来源:PGPSecretKeyRingCollection.java


示例3: PGPPublicKey

import org.bouncycastle.openpgp.operator.KeyFingerPrintCalculator; //导入依赖的package包/类
PGPPublicKey(
    PublicKeyPacket publicPk,
    TrustPacket     trustPk,
    List            keySigs,
    List            ids,
    List            idTrusts,
    List            idSigs,
    KeyFingerPrintCalculator fingerPrintCalculator)
    throws PGPException
{
    this.publicPk = publicPk;
    this.trustPk = trustPk;
    this.keySigs = keySigs;
    this.ids = ids;
    this.idTrusts = idTrusts;
    this.idSigs = idSigs;

    init(fingerPrintCalculator);
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:20,代码来源:PGPPublicKey.java


示例4: extractSecrectKeyRings

import org.bouncycastle.openpgp.operator.KeyFingerPrintCalculator; //导入依赖的package包/类
private static List<PGPSecretKeyRing> extractSecrectKeyRings(InputStream inputStream) {

        InputStream decodedInput;
        try {
            decodedInput = PGPUtil.getDecoderStream(inputStream);
        } catch (final IOException e) {
            throw JkUtilsThrowable.unchecked(e);
        }
        final KeyFingerPrintCalculator fingerPrintCalculator = new JcaKeyFingerprintCalculator();
        final InnerPGPObjectFactory pgpFact = new InnerPGPObjectFactory(decodedInput,
                fingerPrintCalculator);
        PGPSecretKeyRing secKeyRing;
        final List<PGPSecretKeyRing> result = new LinkedList<>();
        while ((secKeyRing = pgpFact.nextSecretKey()) != null) {
            result.add(secKeyRing);
        }
        return result;
    }
 
开发者ID:jerkar,项目名称:jerkar,代码行数:19,代码来源:PgpUtils.java


示例5: PGPSecretKeyRing

import org.bouncycastle.openpgp.operator.KeyFingerPrintCalculator; //导入依赖的package包/类
public PGPSecretKeyRing(
    byte[]    encoding,
    KeyFingerPrintCalculator fingerPrintCalculator)
    throws IOException, PGPException
{
    this(new ByteArrayInputStream(encoding), fingerPrintCalculator);
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:8,代码来源:PGPSecretKeyRing.java


示例6: PGPObjectFactory

import org.bouncycastle.openpgp.operator.KeyFingerPrintCalculator; //导入依赖的package包/类
/**
 * Create an object factory suitable for reading PGP objects such as keys, key rings and key
 * ring collections, or PGP encrypted data.
 *
 * @param in stream to read PGP data from.
 * @param fingerPrintCalculator calculator to use in key finger print calculations.
 */
public PGPObjectFactory(
    InputStream              in,
    KeyFingerPrintCalculator fingerPrintCalculator)
{
    this.in = new BCPGInputStream(in);
    this.fingerPrintCalculator = fingerPrintCalculator;
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:15,代码来源:PGPObjectFactory.java


示例7: init

import org.bouncycastle.openpgp.operator.KeyFingerPrintCalculator; //导入依赖的package包/类
private void init(KeyFingerPrintCalculator fingerPrintCalculator)
    throws PGPException
{
    BCPGKey                key = publicPk.getKey();

    this.fingerprint = fingerPrintCalculator.calculateFingerprint(publicPk);

    if (publicPk.getVersion() <= 3)
    {
        RSAPublicBCPGKey    rK = (RSAPublicBCPGKey)key;
        
        this.keyID = rK.getModulus().longValue();
        this.keyStrength = rK.getModulus().bitLength();
    }
    else
    {
        this.keyID = ((long)(fingerprint[fingerprint.length - 8] & 0xff) << 56)
                        | ((long)(fingerprint[fingerprint.length - 7] & 0xff) << 48)
                        | ((long)(fingerprint[fingerprint.length - 6] & 0xff) << 40)
                        | ((long)(fingerprint[fingerprint.length - 5] & 0xff) << 32)
                        | ((long)(fingerprint[fingerprint.length - 4] & 0xff) << 24)
                        | ((long)(fingerprint[fingerprint.length - 3] & 0xff) << 16)
                        | ((long)(fingerprint[fingerprint.length - 2] & 0xff) << 8)
                        | ((fingerprint[fingerprint.length - 1] & 0xff));
        
        if (key instanceof RSAPublicBCPGKey)
        {
            this.keyStrength = ((RSAPublicBCPGKey)key).getModulus().bitLength();
        }
        else if (key instanceof DSAPublicBCPGKey)
        {
            this.keyStrength = ((DSAPublicBCPGKey)key).getP().bitLength();
        }
        else if (key instanceof ElGamalPublicBCPGKey)
        {
            this.keyStrength = ((ElGamalPublicBCPGKey)key).getP().bitLength();
        }
    }
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:40,代码来源:PGPPublicKey.java


示例8: PGPPublicKeyRing

import org.bouncycastle.openpgp.operator.KeyFingerPrintCalculator; //导入依赖的package包/类
public PGPPublicKeyRing(
    byte[]    encoding,
    KeyFingerPrintCalculator fingerPrintCalculator)
    throws IOException
{
    this(new ByteArrayInputStream(encoding), fingerPrintCalculator);
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:8,代码来源:PGPPublicKeyRing.java


示例9: readSubkey

import org.bouncycastle.openpgp.operator.KeyFingerPrintCalculator; //导入依赖的package包/类
static PGPPublicKey readSubkey(BCPGInputStream in, KeyFingerPrintCalculator fingerPrintCalculator)
    throws IOException, PGPException
{
    PublicKeyPacket pk = (PublicKeyPacket)in.readPacket();
    TrustPacket     kTrust = readOptionalTrustPacket(in);

    // PGP 8 actually leaves out the signature.
    List sigList = readSignaturesAndTrust(in);

    return new PGPPublicKey(pk, kTrust, sigList, fingerPrintCalculator);
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:12,代码来源:PGPPublicKeyRing.java


示例10: PGPObjectFactory

import org.bouncycastle.openpgp.operator.KeyFingerPrintCalculator; //导入依赖的package包/类
/**
 * Create an object factor suitable for reading keys, key rings and key ring collections.
 *
 * @param in stream to read from
 * @param fingerPrintCalculator  calculator to use in key finger print calculations.
 */
public PGPObjectFactory(
    InputStream              in,
    KeyFingerPrintCalculator fingerPrintCalculator)
{
    this.in = new BCPGInputStream(in);
    this.fingerPrintCalculator = fingerPrintCalculator;
}
 
开发者ID:NoYouShutup,项目名称:CryptMeme,代码行数:14,代码来源:PGPObjectFactory.java



注:本文中的org.bouncycastle.openpgp.operator.KeyFingerPrintCalculator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FlatMapOperator类代码示例发布时间:2022-05-23
下一篇:
Java XSVisitor类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap