01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: /**
18: * @author Stepan M. Mishura
19: * @version $Revision$
20: */package org.apache.harmony.security.x501;
21:
22: import org.apache.harmony.security.asn1.ASN1OpenType;
23: import org.apache.harmony.security.asn1.ASN1Sequence;
24: import org.apache.harmony.security.asn1.ASN1SetOf;
25: import org.apache.harmony.security.asn1.ASN1Type;
26: import org.apache.harmony.security.asn1.InformationObjectSet;
27:
28: /**
29: * X.501 Attributes
30: *
31: * This is a draft class for Module InformationFramework (X.501).
32: *
33: * @see http://www.itu.int/ITU-T/asn1/database/itu-t/x/x501/2001/InformationFramework.html
34: */
35:
36: public class Attributes {
37:
38: /**
39: * The class corresponds to following ASN.1 type:
40: *
41: * Attribute ::= SEQUENCE {
42: * type AttributeType,
43: * values SET SIZE (0..MAX) OF AttributeValue }
44: *
45: * AttributeType ::= OBJECT IDENTIFIER
46: *
47: * AttributeValue ::= ANY DEFINED BY AttributeType
48: *
49: */
50: public static ASN1Sequence getASN1(InformationObjectSet set) {
51: ASN1OpenType.Id id = new ASN1OpenType.Id();
52: ASN1OpenType any = new ASN1OpenType(id, set);
53:
54: return new ASN1Sequence(
55: new ASN1Type[] { id, new ASN1SetOf(any) });
56: }
57: }
|