本文整理汇总了Java中org.bouncycastle.openpgp.PGPPublicKey.ECDSA属性的典型用法代码示例。如果您正苦于以下问题:Java PGPPublicKey.ECDSA属性的具体用法?Java PGPPublicKey.ECDSA怎么用?Java PGPPublicKey.ECDSA使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.bouncycastle.openpgp.PGPPublicKey
的用法示例。
在下文中一共展示了PGPPublicKey.ECDSA属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: PublicKeyKeyEncryptionMethodGenerator
protected PublicKeyKeyEncryptionMethodGenerator(
PGPPublicKey pubKey)
{
this.pubKey = pubKey;
switch (pubKey.getAlgorithm())
{
case PGPPublicKey.RSA_ENCRYPT:
case PGPPublicKey.RSA_GENERAL:
break;
case PGPPublicKey.RSA_SIGN:
throw new IllegalArgumentException("Can't use an RSA_SIGN key for encryption.");
case PGPPublicKey.ELGAMAL_ENCRYPT:
case PGPPublicKey.ELGAMAL_GENERAL:
break;
case PGPPublicKey.ECDH:
break;
case PGPPublicKey.DSA:
throw new IllegalArgumentException("Can't use DSA for encryption.");
case PGPPublicKey.ECDSA:
throw new IllegalArgumentException("Can't use ECDSA for encryption.");
default:
throw new IllegalArgumentException("unknown asymmetric algorithm: " + pubKey.getAlgorithm());
}
}