krypt-core 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +20 -0
- data/ext/krypt/core/Makefile +221 -0
- data/ext/krypt/core/binyo-error.h +40 -0
- data/ext/krypt/core/binyo-io-buffer.h +54 -0
- data/ext/krypt/core/binyo-io.h +131 -0
- data/ext/krypt/core/extconf.h +8 -0
- data/ext/krypt/core/extconf.rb +80 -0
- data/ext/krypt/core/krypt-core.c +110 -0
- data/ext/krypt/core/krypt-core.h +97 -0
- data/ext/krypt/core/krypt-core.o +0 -0
- data/ext/krypt/core/krypt-provider.h +86 -0
- data/ext/krypt/core/krypt_asn1-internal.c +681 -0
- data/ext/krypt/core/krypt_asn1-internal.h +117 -0
- data/ext/krypt/core/krypt_asn1-internal.o +0 -0
- data/ext/krypt/core/krypt_asn1.c +2109 -0
- data/ext/krypt/core/krypt_asn1.h +88 -0
- data/ext/krypt/core/krypt_asn1.o +0 -0
- data/ext/krypt/core/krypt_asn1_codec.c +973 -0
- data/ext/krypt/core/krypt_asn1_codec.o +0 -0
- data/ext/krypt/core/krypt_asn1_in_adapter.c +178 -0
- data/ext/krypt/core/krypt_asn1_in_adapter.o +0 -0
- data/ext/krypt/core/krypt_asn1_in_chunked.c +292 -0
- data/ext/krypt/core/krypt_asn1_in_chunked.o +0 -0
- data/ext/krypt/core/krypt_asn1_in_definite.c +156 -0
- data/ext/krypt/core/krypt_asn1_in_definite.o +0 -0
- data/ext/krypt/core/krypt_asn1_parser.c +592 -0
- data/ext/krypt/core/krypt_asn1_parser.o +0 -0
- data/ext/krypt/core/krypt_asn1_template-internal.h +185 -0
- data/ext/krypt/core/krypt_asn1_template.c +459 -0
- data/ext/krypt/core/krypt_asn1_template.h +56 -0
- data/ext/krypt/core/krypt_asn1_template.o +0 -0
- data/ext/krypt/core/krypt_asn1_template_encoder.c +76 -0
- data/ext/krypt/core/krypt_asn1_template_encoder.o +0 -0
- data/ext/krypt/core/krypt_asn1_template_parser.c +1176 -0
- data/ext/krypt/core/krypt_asn1_template_parser.o +0 -0
- data/ext/krypt/core/krypt_b64-internal.h +38 -0
- data/ext/krypt/core/krypt_b64.c +391 -0
- data/ext/krypt/core/krypt_b64.h +41 -0
- data/ext/krypt/core/krypt_b64.o +0 -0
- data/ext/krypt/core/krypt_digest.c +391 -0
- data/ext/krypt/core/krypt_digest.h +51 -0
- data/ext/krypt/core/krypt_digest.o +0 -0
- data/ext/krypt/core/krypt_error.c +221 -0
- data/ext/krypt/core/krypt_error.h +46 -0
- data/ext/krypt/core/krypt_error.o +0 -0
- data/ext/krypt/core/krypt_hex-internal.h +36 -0
- data/ext/krypt/core/krypt_hex.c +255 -0
- data/ext/krypt/core/krypt_hex.h +41 -0
- data/ext/krypt/core/krypt_hex.o +0 -0
- data/ext/krypt/core/krypt_io.c +65 -0
- data/ext/krypt/core/krypt_io.h +56 -0
- data/ext/krypt/core/krypt_io.o +0 -0
- data/ext/krypt/core/krypt_io_in_pem.c +397 -0
- data/ext/krypt/core/krypt_io_in_pem.o +0 -0
- data/ext/krypt/core/krypt_missing.c +238 -0
- data/ext/krypt/core/krypt_missing.h +62 -0
- data/ext/krypt/core/krypt_missing.o +0 -0
- data/ext/krypt/core/krypt_pem.c +171 -0
- data/ext/krypt/core/krypt_pem.o +0 -0
- data/ext/krypt/core/krypt_provider-internal.h +40 -0
- data/ext/krypt/core/krypt_provider.c +136 -0
- data/ext/krypt/core/krypt_provider.o +0 -0
- data/ext/krypt/core/kryptcore.so +0 -0
- data/ext/krypt/core/mkmf.log +130 -0
- data/lib/krypt-core/version.rb +3 -0
- data/lib/krypt-core.rb +35 -0
- data/lib/kryptcore.so +0 -0
- data/spec/README +2 -0
- data/test/README +2 -0
- data/test/res/certificate.cer +0 -0
- data/test/resources.rb +48 -0
- data/test/scratch.rb +17 -0
- metadata +150 -0
@@ -0,0 +1,88 @@
|
|
1
|
+
/*
|
2
|
+
* krypt-core API - C implementation
|
3
|
+
*
|
4
|
+
* Copyright (c) 2011-2013
|
5
|
+
* Hiroshi Nakamura <nahi@ruby-lang.org>
|
6
|
+
* Martin Bosslet <martin.bosslet@gmail.com>
|
7
|
+
* All rights reserved.
|
8
|
+
*
|
9
|
+
* Permission is hereby granted, free of charge, to any person obtaining
|
10
|
+
* a copy of this software and associated documentation files (the
|
11
|
+
* "Software"), to deal in the Software without restriction, including
|
12
|
+
* without limitation the rights to use, copy, modify, merge, publish,
|
13
|
+
* distribute, sublicense, and/or sell copies of the Software, and to
|
14
|
+
* permit persons to whom the Software is furnished to do so, subject to
|
15
|
+
* the following conditions:
|
16
|
+
*
|
17
|
+
* The above copyright notice and this permission notice shall be
|
18
|
+
* included in all copies or substantial portions of the Software.
|
19
|
+
*
|
20
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
21
|
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
22
|
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
23
|
+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
24
|
+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
25
|
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
26
|
+
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
27
|
+
*/
|
28
|
+
|
29
|
+
#if !defined(_KRYPT_ASN1_H_)
|
30
|
+
#define _KRYPT_ASN1_H_
|
31
|
+
|
32
|
+
extern VALUE mKryptASN1;
|
33
|
+
extern VALUE cKryptASN1Parser;
|
34
|
+
extern VALUE cKryptASN1Header;
|
35
|
+
extern VALUE cKryptASN1Instream;
|
36
|
+
|
37
|
+
extern VALUE cKryptASN1Data;
|
38
|
+
extern VALUE cKryptASN1Primitive;
|
39
|
+
extern VALUE cKryptASN1Constructive;
|
40
|
+
|
41
|
+
/* PRIMITIVE */
|
42
|
+
extern VALUE cKryptASN1EndOfContents;
|
43
|
+
extern VALUE cKryptASN1Boolean; /* BOOLEAN */
|
44
|
+
extern VALUE cKryptASN1Integer, cKryptASN1Enumerated; /* INTEGER */
|
45
|
+
extern VALUE cKryptASN1BitString; /* BIT STRING */
|
46
|
+
extern VALUE cKryptASN1OctetString, cKryptASN1UTF8String; /* STRINGs */
|
47
|
+
extern VALUE cKryptASN1NumericString, cKryptASN1PrintableString;
|
48
|
+
extern VALUE cKryptASN1T61String, cKryptASN1VideotexString;
|
49
|
+
extern VALUE cKryptASN1IA5String, cKryptASN1GraphicString;
|
50
|
+
extern VALUE cKryptASN1ISO64String, cKryptASN1GeneralString;
|
51
|
+
extern VALUE cKryptASN1UniversalString, cKryptASN1BMPString;
|
52
|
+
extern VALUE cKryptASN1Null; /* NULL */
|
53
|
+
extern VALUE cKryptASN1ObjectId; /* OBJECT IDENTIFIER */
|
54
|
+
extern VALUE cKryptASN1UTCTime, cKryptASN1GeneralizedTime; /* TIME */
|
55
|
+
|
56
|
+
/* CONSTRUCTIVE */
|
57
|
+
extern VALUE cKryptASN1Sequence, cKryptASN1Set;
|
58
|
+
|
59
|
+
extern VALUE eKryptASN1Error;
|
60
|
+
extern VALUE eKryptASN1ParseError;
|
61
|
+
extern VALUE eKryptASN1SerializeError;
|
62
|
+
|
63
|
+
extern VALUE mKryptPEM;
|
64
|
+
extern VALUE eKryptPEMError;
|
65
|
+
|
66
|
+
extern ID sKrypt_TC_UNIVERSAL;
|
67
|
+
extern ID sKrypt_TC_APPLICATION;
|
68
|
+
extern ID sKrypt_TC_CONTEXT_SPECIFIC;
|
69
|
+
extern ID sKrypt_TC_PRIVATE;
|
70
|
+
/* Not real tag classes, for convenience reasons */
|
71
|
+
extern ID sKrypt_TC_EXPLICIT;
|
72
|
+
extern ID sKrypt_TC_IMPLICIT;
|
73
|
+
|
74
|
+
extern ID sKrypt_IV_TAG, sKrypt_IV_TAG_CLASS, sKrypt_IV_INF_LEN, sKrypt_IV_VALUE, sKrypt_IV_UNUSED_BITS;
|
75
|
+
|
76
|
+
void Init_krypt_asn1(void);
|
77
|
+
void Init_krypt_asn1_parser(void);
|
78
|
+
void Init_krypt_instream_adapter(void);
|
79
|
+
void Init_krypt_pem(void);
|
80
|
+
|
81
|
+
size_t krypt_asn1_encode_integer(long num, uint8_t **out);
|
82
|
+
int krypt_asn1_decode_stream(binyo_instream *in, VALUE *out);
|
83
|
+
|
84
|
+
VALUE krypt_instream_adapter_new(binyo_instream *in);
|
85
|
+
|
86
|
+
#endif /* _KRYPT_ASN1_H_ */
|
87
|
+
|
88
|
+
|
Binary file
|