本文整理汇总了Java中org.bouncycastle.asn1.cms.Attributes类的典型用法代码示例。如果您正苦于以下问题:Java Attributes类的具体用法?Java Attributes怎么用?Java Attributes使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Attributes类属于org.bouncycastle.asn1.cms包,在下文中一共展示了Attributes类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: signTimeStamp
import org.bouncycastle.asn1.cms.Attributes; //导入依赖的package包/类
/**
* We are extending CMS Signature
*
* @param signer
* information about signer
* @return information about SignerInformation
*/
private SignerInformation signTimeStamp(SignerInformation signer) throws IOException, TSPException {
AttributeTable unsignedAttributes = signer.getUnsignedAttributes();
ASN1EncodableVector vector = new ASN1EncodableVector();
if (unsignedAttributes != null) {
vector = unsignedAttributes.toASN1EncodableVector();
}
byte[] token = tsaClient.getTimeStampToken(signer.getSignature());
ASN1ObjectIdentifier oid = PKCSObjectIdentifiers.id_aa_signatureTimeStampToken;
ASN1Encodable signatureTimeStamp = new Attribute(oid, new DERSet(ASN1Primitive.fromByteArray(token)));
vector.add(signatureTimeStamp);
Attributes signedAttributes = new Attributes(vector);
SignerInformation newSigner = SignerInformation.replaceUnsignedAttributes(signer,
new AttributeTable(signedAttributes));
return newSigner;
}
开发者ID:beat2,项目名称:pdfbox-signer,代码行数:28,代码来源:Signing.java
示例2: setMetaData
import org.bouncycastle.asn1.cms.Attributes; //导入依赖的package包/类
/**
* Set the MetaData for the generated message.
*
* @param hashProtected true if the MetaData should be included in first imprint calculation, false otherwise.
* @param fileName optional file name, may be null.
* @param mediaType optional media type, may be null.
* @param attributes optional attributes, may be null.
*/
public void setMetaData(boolean hashProtected, String fileName, String mediaType, Attributes attributes)
{
DERUTF8String asn1FileName = null;
if (fileName != null)
{
asn1FileName = new DERUTF8String(fileName);
}
DERIA5String asn1MediaType = null;
if (mediaType != null)
{
asn1MediaType = new DERIA5String(mediaType);
}
setMetaData(hashProtected, asn1FileName, asn1MediaType, attributes);
}
开发者ID:credentials,项目名称:irma_future_id,代码行数:27,代码来源:CMSTimeStampedGenerator.java
示例3: getOtherMetaData
import org.bouncycastle.asn1.cms.Attributes; //导入依赖的package包/类
Attributes getOtherMetaData()
{
if (metaData != null)
{
return metaData.getOtherMetaData();
}
return null;
}
开发者ID:Appdome,项目名称:ipack,代码行数:10,代码来源:MetaDataUtil.java
示例4: setMetaData
import org.bouncycastle.asn1.cms.Attributes; //导入依赖的package包/类
private void setMetaData(boolean hashProtected, DERUTF8String fileName, DERIA5String mediaType, Attributes attributes)
{
this.metaData = new MetaData(ASN1Boolean.getInstance(hashProtected), fileName, mediaType, attributes);
}
开发者ID:Appdome,项目名称:ipack,代码行数:5,代码来源:CMSTimeStampedGenerator.java
注:本文中的org.bouncycastle.asn1.cms.Attributes类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论