Java 类org.bouncycastle.asn1.cms.Attributes 实例源码

项目:pdfbox-signer    文件:Signing.java   
/**
 * 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;
}
项目:irma_future_id    文件:CMSTimeStampedGenerator.java   
/**
 * 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);
}
项目:irma_future_id    文件:CMSTimeStampedGenerator.java   
/**
 * 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);
}
项目:irma_future_id    文件:CMSTimeStampedGenerator.java   
/**
 * 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);
}
项目:bc-java    文件:CMSTimeStampedGenerator.java   
/**
 * 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);
}
项目:bc-java    文件:CMSTimeStampedGenerator.java   
/**
 * 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);
}
项目:bc-java    文件:CMSTimeStampedGenerator.java   
/**
 * 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);
}
项目:ipack    文件:MetaDataUtil.java   
Attributes getOtherMetaData()
{
    if (metaData != null)
    {
        return metaData.getOtherMetaData();
    }

    return null;
}
项目:gwt-crypto    文件:MetaDataUtil.java   
Attributes getOtherMetaData()
{
    if (metaData != null)
    {
        return metaData.getOtherMetaData();
    }

    return null;
}
项目:Aki-SSL    文件:MetaDataUtil.java   
Attributes getOtherMetaData()
{
    if (metaData != null)
    {
        return metaData.getOtherMetaData();
    }

    return null;
}
项目:irma_future_id    文件:MetaDataUtil.java   
Attributes getOtherMetaData()
{
    if (metaData != null)
    {
        return metaData.getOtherMetaData();
    }

    return null;
}
项目:bc-java    文件:MetaDataUtil.java   
Attributes getOtherMetaData()
{
    if (metaData != null)
    {
        return metaData.getOtherMetaData();
    }

    return null;
}
项目:ipack    文件:CMSTimeStampedGenerator.java   
private void setMetaData(boolean hashProtected, DERUTF8String fileName, DERIA5String mediaType, Attributes attributes)
{
    this.metaData = new MetaData(ASN1Boolean.getInstance(hashProtected), fileName, mediaType, attributes);
}
项目:gwt-crypto    文件:CMSTimeStampedGenerator.java   
private void setMetaData(boolean hashProtected, DERUTF8String fileName, DERIA5String mediaType, Attributes attributes)
{
    this.metaData = new MetaData(ASN1Boolean.getInstance(hashProtected), fileName, mediaType, attributes);
}
项目:Aki-SSL    文件:CMSTimeStampedGenerator.java   
private void setMetaData(boolean hashProtected, DERUTF8String fileName, DERIA5String mediaType, Attributes attributes)
{
    this.metaData = new MetaData(ASN1Boolean.getInstance(hashProtected), fileName, mediaType, attributes);
}
项目:irma_future_id    文件:CMSTimeStampedGenerator.java   
private void setMetaData(boolean hashProtected, DERUTF8String fileName, DERIA5String mediaType, Attributes attributes)
{
    this.metaData = new MetaData(ASN1Boolean.getInstance(hashProtected), fileName, mediaType, attributes);
}
项目:irma_future_id    文件:CMSTimeStampedGenerator.java   
private void setMetaData(boolean hashProtected, DERUTF8String fileName, DERIA5String mediaType, Attributes attributes)
{
    this.metaData = new MetaData(ASN1Boolean.getInstance(hashProtected), fileName, mediaType, attributes);
}
项目:irma_future_id    文件:CMSTimeStampedGenerator.java   
private void setMetaData(boolean hashProtected, DERUTF8String fileName, DERIA5String mediaType, Attributes attributes)
{
    this.metaData = new MetaData(ASN1Boolean.getInstance(hashProtected), fileName, mediaType, attributes);
}
项目:bc-java    文件:CMSTimeStampedGenerator.java   
private void setMetaData(boolean hashProtected, DERUTF8String fileName, DERIA5String mediaType, Attributes attributes)
{
    this.metaData = new MetaData(ASN1Boolean.getInstance(hashProtected), fileName, mediaType, attributes);
}
项目:bc-java    文件:CMSTimeStampedGenerator.java   
private void setMetaData(boolean hashProtected, DERUTF8String fileName, DERIA5String mediaType, Attributes attributes)
{
    this.metaData = new MetaData(ASN1Boolean.getInstance(hashProtected), fileName, mediaType, attributes);
}
项目:bc-java    文件:CMSTimeStampedGenerator.java   
private void setMetaData(boolean hashProtected, DERUTF8String fileName, DERIA5String mediaType, Attributes attributes)
{
    this.metaData = new MetaData(ASN1Boolean.getInstance(hashProtected), fileName, mediaType, attributes);
}