Allow UTCTIME objects to be retrieved. Check for imminent cert expiry.
[openssl.git] / crypto / asn1 / asn1.h
index aba0b5fe71c7d1dd7932ed5ce6b29a57446bcf6e..f340ed41df346800038a9e5115f6c32954a6da49 100644 (file)
 #ifndef HEADER_ASN1_H
 #define HEADER_ASN1_H
 
-#ifdef  __cplusplus
-extern "C" {
-#endif
-
 #include <time.h>
 #include <openssl/bn.h>
 #include <openssl/stack.h>
@@ -72,6 +68,10 @@ extern "C" {
 #include <openssl/vms_idhacks.h>
 #endif
 
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
 #define V_ASN1_UNIVERSAL               0x00
 #define        V_ASN1_APPLICATION              0x40
 #define V_ASN1_CONTEXT_SPECIFIC                0x80
@@ -81,7 +81,7 @@ extern "C" {
 #define V_ASN1_PRIMITIVE_TAG           0x1f
 #define V_ASN1_PRIMATIVE_TAG           0x1f
 
-#define V_ASN1_APP_CHOOSE              -2      /* let the recipent choose */
+#define V_ASN1_APP_CHOOSE              -2      /* let the recipient choose */
 
 #define V_ASN1_UNDEF                   -1
 #define V_ASN1_EOC                     0
@@ -176,7 +176,7 @@ typedef struct asn1_ctx_st
        int tag;        /* tag from last 'get object' */
        int xclass;     /* class from last 'get object' */
        long slen;      /* length of last 'get object' */
-       unsigned char *max; /* largest value of p alowed */
+       unsigned char *max; /* largest value of p allowed */
        unsigned char *q;/* temporary variable */
        unsigned char **pp;/* variable */
        int line;       /* used in error processing */
@@ -215,6 +215,7 @@ typedef struct asn1_string_st
 #define STABLE_NO_MASK         0x02
 #define DIRSTRING_TYPE \
  (B_ASN1_PRINTABLESTRING|B_ASN1_T61STRING|B_ASN1_BMPSTRING|B_ASN1_UTF8STRING)
+#define PKCS9STRING_TYPE (DIRSTRING_TYPE|B_ASN1_IA5STRING)
 
 typedef struct asn1_string_table_st {
        int nid;
@@ -237,7 +238,7 @@ DECLARE_STACK_OF(ASN1_STRING_TABLE)
 #define ub_title                       64
 #define ub_email_address               128
 
-#ifndef DEBUG
+#ifdef NO_ASN1_TYPEDEFS
 #define ASN1_INTEGER           ASN1_STRING
 #define ASN1_ENUMERATED                ASN1_STRING
 #define ASN1_BIT_STRING                ASN1_STRING
@@ -578,6 +579,7 @@ ASN1_ENUMERATED *d2i_ASN1_ENUMERATED(ASN1_ENUMERATED **a,unsigned char **pp,
 int ASN1_UTCTIME_check(ASN1_UTCTIME *a);
 ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s,time_t t);
 int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, char *str); 
+time_t ASN1_UTCTIME_get(const ASN1_UTCTIME *s);
 
 int ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *a);
 ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,time_t t);
@@ -785,6 +787,7 @@ int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,
 ASN1_STRING *ASN1_STRING_set_by_NID(ASN1_STRING **out, 
                const unsigned char *in, int inlen, int inform, int nid);
 ASN1_STRING_TABLE *ASN1_STRING_TABLE_get(int nid);
+int ASN1_STRING_TABLE_add(int, long, long, unsigned long, unsigned long);
 void ASN1_STRING_TABLE_cleanup(void);
 
 /* BEGIN ERROR CODES */