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


Java Digest.getAlgorithmName方法代碼示例

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


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

示例1: OldPKCS12ParametersGenerator

import org.bouncycastle.crypto.Digest; //導入方法依賴的package包/類
/**
 * Construct a PKCS 12 Parameters generator. This constructor will
 * accept MD5, SHA1, and RIPEMD160.
 *
 * @param digest the digest to be used as the source of derived keys.
 * @exception IllegalArgumentException if an unknown digest is passed in.
 */
public OldPKCS12ParametersGenerator(
    Digest  digest)
{
    this.digest = digest;
    if (digest instanceof MD5Digest)
    {
        u = 128 / 8;
        v = 512 / 8;
    }
    else if (digest instanceof SHA1Digest)
    {
        u = 160 / 8;
        v = 512 / 8;
    }
    else if (digest instanceof RIPEMD160Digest)
    {
        u = 160 / 8;
        v = 512 / 8;
    }
    else
    {
        throw new IllegalArgumentException("Digest " + digest.getAlgorithmName() + " unsupported");
    }
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:32,代碼來源:BrokenPBE.java

示例2: getByteLength

import org.bouncycastle.crypto.Digest; //導入方法依賴的package包/類
private static int getByteLength(
    Digest digest)
{
    if (digest instanceof ExtendedDigest)
    {
        return ((ExtendedDigest)digest).getByteLength();
    }
    
    Integer  b = (Integer)blockLengths.get(digest.getAlgorithmName());
    
    if (b == null)
    {       
        throw new IllegalArgumentException("unknown digest passed: " + digest.getAlgorithmName());
    }
    
    return b.intValue();
}
 
開發者ID:PhilippC,項目名稱:keepass2android,代碼行數:18,代碼來源:HMac.java

示例3: PKCS12ParametersGenerator

import org.bouncycastle.crypto.Digest; //導入方法依賴的package包/類
/**
 * Construct a PKCS 12 Parameters generator. This constructor will
 * accept any digest which also implements ExtendedDigest.
 *
 * @param digest the digest to be used as the source of derived keys.
 * @exception IllegalArgumentException if an unknown digest is passed in.
 */
public PKCS12ParametersGenerator(
    Digest  digest)
{
    this.digest = digest;
    if (digest instanceof ExtendedDigest)
    {
        u = digest.getDigestSize();
        v = ((ExtendedDigest)digest).getByteLength();
    }
    else
    {
        throw new IllegalArgumentException("Digest " + digest.getAlgorithmName() + " unsupported");
    }
}
 
開發者ID:PhilippC,項目名稱:keepass2android,代碼行數:22,代碼來源:PKCS12ParametersGenerator.java

示例4: BCMessageDigest

import org.bouncycastle.crypto.Digest; //導入方法依賴的package包/類
protected BCMessageDigest(
    Digest digest)
{
    super(digest.getAlgorithmName());

    this.digest = digest;
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:8,代碼來源:BCMessageDigest.java


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