01: package org.bouncycastle.asn1.smime;
02:
03: import org.bouncycastle.asn1.ASN1EncodableVector;
04: import org.bouncycastle.asn1.DEREncodable;
05: import org.bouncycastle.asn1.DEREncodableVector;
06: import org.bouncycastle.asn1.DERInteger;
07: import org.bouncycastle.asn1.DERObjectIdentifier;
08: import org.bouncycastle.asn1.DERSequence;
09:
10: /**
11: * Handler for creating a vector S/MIME Capabilities
12: */
13: public class SMIMECapabilityVector {
14: private ASN1EncodableVector capabilities = new ASN1EncodableVector();
15:
16: public void addCapability(DERObjectIdentifier capability) {
17: capabilities.add(new DERSequence(capability));
18: }
19:
20: public void addCapability(DERObjectIdentifier capability, int value) {
21: ASN1EncodableVector v = new ASN1EncodableVector();
22:
23: v.add(capability);
24: v.add(new DERInteger(value));
25:
26: capabilities.add(new DERSequence(v));
27: }
28:
29: public void addCapability(DERObjectIdentifier capability,
30: DEREncodable params) {
31: ASN1EncodableVector v = new ASN1EncodableVector();
32:
33: v.add(capability);
34: v.add(params);
35:
36: capabilities.add(new DERSequence(v));
37: }
38:
39: public DEREncodableVector toDEREncodableVector() {
40: return capabilities;
41: }
42: }
|