org.spongycastle.asn1.smime.SMIMECapabilityVector Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scprov-jdk15on Show documentation
Show all versions of scprov-jdk15on Show documentation
The Bouncy Castle Crypto package is a Java implementation of cryptographic algorithms.
This jar contains JCE provider for the Bouncy Castle Cryptography APIs for JDK 1.5 to JDK 1.7.
package org.spongycastle.asn1.smime;
import org.spongycastle.asn1.ASN1Encodable;
import org.spongycastle.asn1.ASN1EncodableVector;
import org.spongycastle.asn1.ASN1Integer;
import org.spongycastle.asn1.ASN1ObjectIdentifier;
import org.spongycastle.asn1.DERSequence;
/**
* Handler for creating a vector S/MIME Capabilities
*/
public class SMIMECapabilityVector
{
private ASN1EncodableVector capabilities = new ASN1EncodableVector();
public void addCapability(
ASN1ObjectIdentifier capability)
{
capabilities.add(new DERSequence(capability));
}
public void addCapability(
ASN1ObjectIdentifier capability,
int value)
{
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(capability);
v.add(new ASN1Integer(value));
capabilities.add(new DERSequence(v));
}
public void addCapability(
ASN1ObjectIdentifier capability,
ASN1Encodable params)
{
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(capability);
v.add(params);
capabilities.add(new DERSequence(v));
}
public ASN1EncodableVector toASN1EncodableVector()
{
return capabilities;
}
}