本文整理匯總了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");
}
}
示例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();
}
示例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");
}
}
示例4: BCMessageDigest
import org.bouncycastle.crypto.Digest; //導入方法依賴的package包/類
protected BCMessageDigest(
Digest digest)
{
super(digest.getAlgorithmName());
this.digest = digest;
}