本文整理汇总了Java中org.bouncycastle.operator.InputDecryptorProvider.get方法的典型用法代码示例。如果您正苦于以下问题:Java InputDecryptorProvider.get方法的具体用法?Java InputDecryptorProvider.get怎么用?Java InputDecryptorProvider.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bouncycastle.operator.InputDecryptorProvider
的用法示例。
在下文中一共展示了InputDecryptorProvider.get方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: decryptPrivateKeyInfo
import org.bouncycastle.operator.InputDecryptorProvider; //导入方法依赖的package包/类
public PrivateKeyInfo decryptPrivateKeyInfo(InputDecryptorProvider inputDecryptorProvider)
throws PKCSException
{
try
{
InputDecryptor decrytor = inputDecryptorProvider.get(encryptedPrivateKeyInfo.getEncryptionAlgorithm());
ByteArrayInputStream encIn = new ByteArrayInputStream(encryptedPrivateKeyInfo.getEncryptedData());
return PrivateKeyInfo.getInstance(Streams.readAll(decrytor.getInputStream(encIn)));
}
catch (Exception e)
{
throw new PKCSException("unable to read encrypted data: " + e.getMessage(), e);
}
}
示例2: getContentStream
import org.bouncycastle.operator.InputDecryptorProvider; //导入方法依赖的package包/类
public CMSTypedStream getContentStream(InputDecryptorProvider inputDecryptorProvider)
throws CMSException
{
try
{
EncryptedContentInfo encContentInfo = encryptedData.getEncryptedContentInfo();
InputDecryptor decrytor = inputDecryptorProvider.get(encContentInfo.getContentEncryptionAlgorithm());
ByteArrayInputStream encIn = new ByteArrayInputStream(encContentInfo.getEncryptedContent().getOctets());
return new CMSTypedStream(encContentInfo.getContentType(), decrytor.getInputStream(encIn));
}
catch (Exception e)
{
throw new CMSException("unable to create stream: " + e.getMessage(), e);
}
}