本文整理汇总了Java中gnu.java.security.key.rsa.RSAKeyPairX509Codec类的典型用法代码示例。如果您正苦于以下问题:Java RSAKeyPairX509Codec类的具体用法?Java RSAKeyPairX509Codec怎么用?Java RSAKeyPairX509Codec使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RSAKeyPairX509Codec类属于gnu.java.security.key.rsa包,在下文中一共展示了RSAKeyPairX509Codec类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getKeyPairCodec
点赞 2
import gnu.java.security.key.rsa.RSAKeyPairX509Codec; //导入依赖的package包/类
private IKeyPairCodec getKeyPairCodec(int keyTypeAndFormatID)
throws KeyAgreementException
{
int keyType = (keyTypeAndFormatID >>> 4) & 0x0F;
int formatID = keyTypeAndFormatID & 0x0F;
switch (formatID)
{
case Registry.RAW_ENCODING_ID:
switch (keyType)
{
case 0:
return new DSSKeyPairRawCodec();
case 1:
return new RSAKeyPairRawCodec();
case 2:
return new DHKeyPairRawCodec();
case 3:
return new SRPKeyPairRawCodec();
default:
throw new KeyAgreementException("Unknown key-type for Raw format: "
+ keyType);
}
case Registry.X509_ENCODING_ID:
switch (keyType)
{
case 0:
return new DSSKeyPairX509Codec();
case 1:
return new RSAKeyPairX509Codec();
case 2:
return new DHKeyPairX509Codec();
default:
throw new KeyAgreementException("Unknown key-type for X.509 format: "
+ keyType);
}
case Registry.PKCS8_ENCODING_ID:
switch (keyType)
{
case 0:
return new DSSKeyPairPKCS8Codec();
case 1:
return new RSAKeyPairPKCS8Codec();
case 2:
return new DHKeyPairPKCS8Codec();
default:
throw new KeyAgreementException("Unknown key-type for PKCS#8 format: "
+ keyType);
}
default:
throw new KeyAgreementException("Unknown format identifier: "
+ formatID);
}
}
开发者ID:vilie,
项目名称:javify,
代码行数:54,
代码来源:IncomingMessage.java