本文整理汇总了Java中org.bouncycastle.asn1.smime.SMIMECapabilities类的典型用法代码示例。如果您正苦于以下问题:Java SMIMECapabilities类的具体用法?Java SMIMECapabilities怎么用?Java SMIMECapabilities使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SMIMECapabilities类属于org.bouncycastle.asn1.smime包,在下文中一共展示了SMIMECapabilities类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: CertEtcToken
import org.bouncycastle.asn1.smime.SMIMECapabilities; //导入依赖的package包/类
private CertEtcToken(ASN1TaggedObject choice)
{
this.tagNo = choice.getTagNo();
switch (tagNo)
{
case TAG_CERTIFICATE:
value = Certificate.getInstance(choice, false);
break;
case TAG_ESSCERTID:
value = ESSCertID.getInstance(choice.getObject());
break;
case TAG_PKISTATUS:
value = PKIStatusInfo.getInstance(choice, false);
break;
case TAG_ASSERTION:
value = ContentInfo.getInstance(choice.getObject());
break;
case TAG_CRL:
value = CertificateList.getInstance(choice, false);
break;
case TAG_OCSPCERTSTATUS:
value = CertStatus.getInstance(choice.getObject());
break;
case TAG_OCSPCERTID:
value = CertID.getInstance(choice, false);
break;
case TAG_OCSPRESPONSE:
value = OCSPResponse.getInstance(choice, false);
break;
case TAG_CAPABILITIES:
value = SMIMECapabilities.getInstance(choice.getObject());
break;
default:
throw new IllegalArgumentException("Unknown tag: " + tagNo);
}
}
开发者ID:Appdome,项目名称:ipack,代码行数:38,代码来源:CertEtcToken.java
示例2: getSmimeCapabilitiesStringValue
import org.bouncycastle.asn1.smime.SMIMECapabilities; //导入依赖的package包/类
/**
* Get S/MIME capabilities (1.2.840.113549.1.9.15) extension value as a string.
*
* <pre>
* SMIMECapability ::= SEQUENCE {
* capabilityID OBJECT IDENTIFIER,
* parameters ANY DEFINED BY capabilityID OPTIONAL }
* SMIMECapabilities ::= SEQUENCE OF SMIMECapability
* </pre>
*
* @see <a href="http://tools.ietf.org/html/rfc2633">RFC 2633</a>
* @param bValue The octet string value
* @return Extension value as a string
* @throws IOException If an I/O problem occurs
*/
private String getSmimeCapabilitiesStringValue(byte[] bValue)
throws IOException
{
SMIMECapabilities caps = SMIMECapabilities.getInstance(ASN1Primitive.fromByteArray(bValue));
String sParams = RB.getString("SmimeParameters");
StringBuilder sb = new StringBuilder();
for (Object o : caps.getCapabilities(null))
{
SMIMECapability cap = (SMIMECapability) o;
String sCapId = cap.getCapabilityID().getId();
String sCap = getRes(sCapId, "UnrecognisedSmimeCapability");
if (sb.length() != 0)
{
sb.append("<br>");
}
sb.append("<ul><li>");
sb.append(MessageFormat.format(sCap, sCapId));
ASN1Encodable params;
if ((params = cap.getParameters()) != null)
{
sb.append("<ul><li>");
sb.append(sParams);
sb.append(": ");
sb.append(stringify(params));
sb.append("</li></ul>");
}
sb.append("</li></ul>");
}
return sb.toString();
}
开发者ID:gavioto,项目名称:portecle,代码行数:55,代码来源:X509Ext.java
注:本文中的org.bouncycastle.asn1.smime.SMIMECapabilities类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论