aboutsummaryrefslogtreecommitdiff
path: root/src/asn1
diff options
context:
space:
mode:
authorValerii Hiora <[email protected]>2014-09-24 19:17:17 +0300
committerValerii Hiora <[email protected]>2014-09-26 10:39:08 +0300
commit4fd169a1e5d465a10d5a815877479baa960a16eb (patch)
tree5ddc3e107274bdf72f00aeaeac67fc698b553473 /src/asn1
parentMerge pull request #46 from vhbit/tls1-2-support (diff)
downloadrust-openssl-4fd169a1e5d465a10d5a815877479baa960a16eb.tar.xz
rust-openssl-4fd169a1e5d465a10d5a815877479baa960a16eb.zip
Certificate/pkey generation & PEM export
Required quite a lot of refactoring
Diffstat (limited to 'src/asn1')
-rw-r--r--src/asn1/mod.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/asn1/mod.rs b/src/asn1/mod.rs
new file mode 100644
index 00000000..d302d6b7
--- /dev/null
+++ b/src/asn1/mod.rs
@@ -0,0 +1,23 @@
+pub mod ffi {
+ #![allow(dead_code)]
+ #![allow(non_camel_case_types)]
+ use libc::{c_int, c_long, c_void};
+
+ pub type ASN1_INTEGER = c_void;
+ pub type ASN1_TIME = c_void;
+ pub type ASN1_STRING = c_void;
+
+ pub static MBSTRING_FLAG: c_int = 0x1000;
+ pub static MBSTRING_UTF8: c_int = MBSTRING_FLAG;
+ pub static MBSTRING_ASC: c_int = MBSTRING_FLAG | 1;
+ pub static MBSTRING_BMP: c_int = MBSTRING_FLAG | 2;
+ pub static MBSTRING_UNIV: c_int = MBSTRING_FLAG | 4;
+
+ pub static V_ASN1_UTCTIME: c_int = 23;
+ pub static V_ASN1_GENERALIZEDTIME: c_int = 24;
+
+ extern "C" {
+ pub fn ASN1_STRING_type_new(ty: c_int) -> *mut ASN1_STRING;
+ pub fn ASN1_INTEGER_set(dest: *mut ASN1_INTEGER, value: c_long) -> c_int;
+ }
+}