aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/test/asn1_SUITE_data/TConstr.asn1
diff options
context:
space:
mode:
authorKenneth Lundin <[email protected]>2010-02-19 14:01:57 +0000
committerErlang/OTP <[email protected]>2010-02-19 14:01:57 +0000
commit18bd1239bee04427340a44f57f993ea92c264e41 (patch)
treedbb3031dcd2e446eb457ff7ac5229949517d7557 /lib/asn1/test/asn1_SUITE_data/TConstr.asn1
parent729565dc3f8bcf8829508136498aef6a542840f4 (diff)
downloadotp-18bd1239bee04427340a44f57f993ea92c264e41.tar.gz
otp-18bd1239bee04427340a44f57f993ea92c264e41.tar.bz2
otp-18bd1239bee04427340a44f57f993ea92c264e41.zip
OTP-8463 Support for EXTENSIBILITY IMPLIED and SET/SEQ OF NamedType is
added.
Diffstat (limited to 'lib/asn1/test/asn1_SUITE_data/TConstr.asn1')
-rw-r--r--lib/asn1/test/asn1_SUITE_data/TConstr.asn195
1 files changed, 95 insertions, 0 deletions
diff --git a/lib/asn1/test/asn1_SUITE_data/TConstr.asn1 b/lib/asn1/test/asn1_SUITE_data/TConstr.asn1
new file mode 100644
index 0000000000..63f5dbde77
--- /dev/null
+++ b/lib/asn1/test/asn1_SUITE_data/TConstr.asn1
@@ -0,0 +1,95 @@
+-- The idea with this spec is to gather definitions that has a
+-- complicated structure of table constraints.
+TConstr DEFINITIONS AUTOMATIC TAGS ::=
+
+BEGIN
+
+MYCLASS ::= CLASS {
+ &id OBJECT IDENTIFIER UNIQUE,
+ &Type,
+ &Result OPTIONAL
+} WITH SYNTAX {
+ ID &id
+ TYPE &Type
+ [RESULT &Result]
+}
+
+object1 MYCLASS ::= {ID id-object1 TYPE Type-object1 RESULT INTEGER}
+object2 MYCLASS ::= {ID id-object2 TYPE Type-object2}
+object3 MYCLASS ::= {ID id-object3 TYPE Type-object3 RESULT BOOLEAN}
+
+ObjectSet MYCLASS ::= {object1 | object2 | object3}
+
+id-object1 OBJECT IDENTIFIER ::= {2 4}
+id-object2 OBJECT IDENTIFIER ::= {2 5}
+id-object3 OBJECT IDENTIFIER ::= {2 6 7}
+
+
+Type-object1 ::= SEQUENCE {
+ a INTEGER,
+ b BOOLEAN
+}
+
+Type-object2 ::= ENUMERATED {first, second, third}
+
+Type-object3 ::= CHOICE {
+ first SEQUENCE {a BOOLEAN, b INTEGER},
+ second INTEGER
+}
+
+Seq1 ::= SEQUENCE {
+ a SEQUENCE {aa INTEGER, ab MYCLASS.&id ({ObjectSet})},
+ b SEQUENCE {ba INTEGER, bb MYCLASS.&Type ({ObjectSet}{@a.ab})}
+}
+
+Seq2 ::= SEQUENCE {
+ identity INTEGER,
+ content SEQUENCE {
+ subid MYCLASS.&id ({ObjectSet}),
+ subcontent MYCLASS.&Type ({ObjectSet}{@content.subid}),
+ subresult MYCLASS.&Result ({ObjectSet}{@content.subid})
+ }
+}
+
+
+-- following from Peter's definitions
+
+
+MY-CLASS ::= CLASS {
+ &id OBJECT IDENTIFIER UNIQUE,
+ &Type }
+ WITH SYNTAX {
+ ID &id
+ TYPE &Type }
+
+Info ::= SEQUENCE {
+ xyz SEQUENCE {
+ abc MY-CLASS.&id({Supported})
+ },
+ uvw MY-CLASS.&Type ({Supported}{@xyz.abc}) }
+
+Supported MY-CLASS ::= { dsa | rsa }
+
+-- dsa
+
+ id-dsa OBJECT IDENTIFIER ::= { 1 2 }
+
+ DSAPublicKey ::= INTEGER -- public key, y
+
+ dsa MY-CLASS ::= {
+ ID id-dsa
+ TYPE DSAPublicKey }
+
+-- rsa
+
+ rsaEncryption OBJECT IDENTIFIER ::= { 1 3 4 }
+
+ RSAPublicKey ::= SEQUENCE {
+ modulus INTEGER, -- n
+ publicExponent INTEGER } -- e
+
+ rsa MY-CLASS ::= {
+ ID rsaEncryption
+ TYPE RSAPublicKey }
+
+END