Moved eel and eapml under the contrib folder.

This commit is contained in:
Jocelyn Fiat
2012-06-15 14:24:23 +02:00
parent 12d56861e6
commit 0203e0fdc7
166 changed files with 3 additions and 3 deletions

View File

@@ -0,0 +1,38 @@
note
description: "x509v3 AlgorithmIdentifier sequence"
author: "Colin LeMahieu"
date: "$Date$"
revision: "$Revision$"
quote: "When you subsidize poverty and failure, you get more of both. - James Dale Davidson, National Taxpayers Union"
class
ALGORITHM_IDENTIFIER
inherit
ANY
redefine
is_equal
end
create
make
feature
make (algorithm_a: OBJECT_IDENTIFIER parameters_a: ALGORITHM_PARAMETERS)
do
algorithm := algorithm_a
parameters := parameters_a
end
is_equal (other: like Current): BOOLEAN
do
result := algorithm ~ other.algorithm and parameters ~ other.parameters
ensure then
algorithm ~ other.algorithm
parameters ~ other.parameters
end
feature
algorithm: OBJECT_IDENTIFIER
parameters: ALGORITHM_PARAMETERS
end

View File

@@ -0,0 +1,11 @@
note
description: "Summary description for {ALGORITHM_PARAMETERS}."
author: "Colin LeMahieu"
date: "$Date$"
revision: "$Revision$"
quote: "If we have to kill 12 people to save 1 human life it will have been worth it. - Unknown"
class
ALGORITHM_PARAMETERS
end

View File

@@ -0,0 +1,24 @@
note
description: "x509v3 AttributeTypeAndValue sequence"
author: "Colin LeMahieu"
date: "$Date$"
revision: "$Revision$"
quote: "Truth and news are not the same thing. - Katharine Graham, owner of The Washington Post"
class
ATTRIBUTE_TYPE_AND_VALUE
create
make
feature
make (type_a: OBJECT_IDENTIFIER value_a: SPECIAL [NATURAL_8])
do
type := type_a
value := value_a
end
feature
type: OBJECT_IDENTIFIER
value: SPECIAL [NATURAL_8]
end

View File

@@ -0,0 +1,29 @@
note
description: "x509v3 Certificate sequence."
author: "Colin LeMahieu"
date: "$Date$"
revision: "$Revision$"
quote: "Everyone thinks about changing the world, but no one thinks about changing himself. - Leo Tolstoy"
class
CERTIFICATE
create
make
feature
make (tbs_certificate_a: TBS_CERTIFICATE signature_algorithm_a: ALGORITHM_IDENTIFIER signature_value_a: SPECIAL [NATURAL_8])
do
tbs_certificate := tbs_certificate_a
signature_algorithm := signature_algorithm_a
signature_value := signature_value_a
end
feature
tbs_certificate: TBS_CERTIFICATE
signature_algorithm: ALGORITHM_IDENTIFIER
signature_value: SPECIAL [NATURAL_8]
invariant
mismatched_algorithms: signature_algorithm ~ tbs_certificate.signature
end

View File

@@ -0,0 +1,26 @@
note
description: "x509v3 extension sequence"
author: "Colin LeMahieu"
date: "$Date$"
revision: "$Revision$"
quote: "The Constitution is not an instrument for the government to restrain the people, it is an instrument for the people to restrain the government - lest it come to dominate our lives and interests. - Patrick Henry"
class
EXTENSION
create
make
feature
make (extn_id_a: OBJECT_IDENTIFIER critical_a: BOOLEAN extn_value_a: SPECIAL [NATURAL_8])
do
extn_id := extn_id_a
critical := critical_a
extn_value := extn_value_a
end
feature
extn_id: OBJECT_IDENTIFIER
critical: BOOLEAN
extn_value: SPECIAL [NATURAL_8]
end

View File

@@ -0,0 +1,22 @@
note
description: "x509v3 Name choice"
author: "Colin LeMahieu"
date: "$Date$"
revision: "$Revision$"
quote: "When goods don't cross borders, soldiers will. - Fredric Bastiat, early French economists"
class
NAME
create
make
feature
make (rdn_sequence_a: LIST [ATTRIBUTE_TYPE_AND_VALUE])
do
rdn_sequence := rdn_sequence_a
end
feature
rdn_sequence: LIST [ATTRIBUTE_TYPE_AND_VALUE]
end

View File

@@ -0,0 +1,108 @@
note
description: "ASN.1 OIDs"
author: "Colin LeMahieu"
date: "$Date$"
revision: "$Revision$"
quote:
"[
Virtually all reasonable laws are obeyed, not because they are the law, but because reasonable people would do that anyway.
If you obey a law simply because it is the law, that's a pretty likely sign that it shouldn't be a law. - Unknown
]"
class
OBJECT_IDENTIFIER
inherit
ANY
redefine
is_equal
end
create
make_md2,
make_md5,
make_id_sha1,
make_md2_with_rsa_encryption,
make_md5_with_rsa_encryption,
make_sha_1_with_rsa_encryption,
make_id_dsa_with_sha1,
make_ecdsa_with_sha1,
make_pkcs_1
feature
make_md2
do
id := "1.2.840.113549.2.2"
end
make_md5
do
id := "1.2.840.113549.2.5"
end
make_id_sha1
do
id := "1.3.14.3.2.26"
end
make_md2_with_rsa_encryption
do
id := "1.2.840.113549.1.1.2"
end
make_md5_with_rsa_encryption
do
id := "1.2.840.113549.1.1.4"
end
make_sha_1_with_rsa_encryption
do
id := "1.2.840.113549.1.1.5"
end
make_id_dsa_with_sha1
do
id := "1.2.840.10040.4.3"
end
make_ecdsa_with_sha1
do
id := "1.2.840.10045.4.1"
end
make_pkcs_1
do
id := "1.2.840.113549.1"
end
make_sha_224_with_rsa_encryption
do
id := "1.2.840.113549.1.14"
end
make_sha_256_with_rsa_encryption
do
id := "1.2.840.113549.1.11"
end
make_sha_384_with_rsa_encryption
do
id := "1.2.840.113549.1.12"
end
make_sha_512_with_rsa_encryption
do
id := "1.2.840.113549.1.13"
end
feature
is_equal (other: like Current): BOOLEAN
do
result := id ~ other.id
ensure then
id ~ other.id
end
feature
id: STRING
end

View File

@@ -0,0 +1,24 @@
note
description: "x509v3 SubjectPublicKeyInfo sequence"
author: "Colin LeMahieu"
date: "$Date$"
revision: "$Revision$"
quote: "One of the penalties for refusing to participate in politics is that you end up being governed by your inferiors. - Plato"
class
SUBJECT_PUBLIC_KEY_INFO
create
make
feature
make (algorithm_a: STRING subject_public_key_a: STRING)
do
algorithm := algorithm_a
subject_public_key := subject_public_key_a
end
feature
algorithm: STRING
subject_public_key: STRING
end

View File

@@ -0,0 +1,72 @@
note
description: "x509v3 TBSCertificate sequence"
author: "Colin LeMahieu"
date: "$Date$"
revision: "$Revision$"
quote: "Democracy is a pathetic belief in the collective wisdom of individual ignorance. - H.L. Mencken"
class
TBS_CERTIFICATE
inherit
DER_ENCODABLE
create
make
feature
make ( version_a: INTEGER_32 serial_number_a: INTEGER_X signature_a: ALGORITHM_IDENTIFIER issuer_a: NAME validity_a: VALIDITY
subject_a: NAME subject_public_key_info_a: SUBJECT_PUBLIC_KEY_INFO issuer_unique_id_a: SPECIAL [NATURAL_8]
subject_unique_id_a: SPECIAL [NATURAL_8] extensions_a: LIST [EXTENSION])
require
do
version := version_a
serial_number := serial_number_a
signature := signature_a
issuer := issuer_a
validity := validity_a
subject := subject_a
subject_public_key_info := subject_public_key_info_a
issuer_unique_id := issuer_unique_id_a
subject_unique_id := subject_unique_id_a
extensions := extensions_a
end
feature
der_encode (target: DER_OCTET_SINK)
do
end
feature
version: INTEGER_32
serial_number: INTEGER_X
signature: ALGORITHM_IDENTIFIER
issuer: NAME
validity: VALIDITY
subject: NAME
subject_public_key_info: SUBJECT_PUBLIC_KEY_INFO
issuer_unique_id: SPECIAL [NATURAL_8]
subject_unique_id: SPECIAL [NATURAL_8]
extensions: LIST [EXTENSION]
feature
valid_version (in: INTEGER_32): BOOLEAN
do
result := in = 2
ensure
result = (in = 2)
end
valid_serial_number (in: INTEGER_X): BOOLEAN
do
result := (in >= in.one) and in.bits <= 20 * 8
ensure
result = ((in >= in.one) and in.bits <= 20 * 8)
end
invariant
valid_version (version)
valid_serial_number (serial_number)
end

View File

@@ -0,0 +1,24 @@
note
description: "x509v3 Validity sequence"
author: "Colin LeMahieu"
date: "$Date$"
revision: "$Revision$"
quote: "If we don't believe in freedom of expression for people we despise, we don't believe in it at all. - Noam Chomsky"
class
VALIDITY
create
make
feature
make (not_before_a: TIME not_after_a: TIME)
do
not_before := not_before_a
not_after := not_after_a
end
feature
not_before: TIME
not_after: TIME
end