2015-01-22 03:40:55 +00:00
|
|
|
/*
|
2016-05-17 18:51:26 +00:00
|
|
|
* Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved.
|
1999-02-17 23:21:01 +00:00
|
|
|
*
|
2016-05-17 18:51:26 +00:00
|
|
|
* Licensed under the OpenSSL license (the "License"). You may not use
|
|
|
|
* this file except in compliance with the License. You can obtain a copy
|
|
|
|
* in the file LICENSE in the source distribution or at
|
|
|
|
* https://www.openssl.org/source/license.html
|
1999-02-17 23:21:01 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
2015-05-14 14:56:48 +00:00
|
|
|
#include "internal/cryptlib.h"
|
1999-04-23 22:13:45 +00:00
|
|
|
#include <openssl/asn1.h>
|
2000-12-08 19:09:35 +00:00
|
|
|
#include <openssl/asn1t.h>
|
1999-04-23 22:13:45 +00:00
|
|
|
#include <openssl/x509v3.h>
|
2015-09-05 12:32:58 +00:00
|
|
|
#include "ext_dat.h"
|
1999-02-17 23:21:01 +00:00
|
|
|
|
2015-01-22 03:40:55 +00:00
|
|
|
static int i2r_PKEY_USAGE_PERIOD(X509V3_EXT_METHOD *method,
|
|
|
|
PKEY_USAGE_PERIOD *usage, BIO *out,
|
|
|
|
int indent);
|
1999-02-21 20:01:39 +00:00
|
|
|
/*
|
2015-01-22 03:40:55 +00:00
|
|
|
* static PKEY_USAGE_PERIOD *v2i_PKEY_USAGE_PERIOD(X509V3_EXT_METHOD *method,
|
|
|
|
* X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *values);
|
|
|
|
*/
|
2007-01-21 13:07:17 +00:00
|
|
|
const X509V3_EXT_METHOD v3_pkey_usage_period = {
|
2015-01-22 03:40:55 +00:00
|
|
|
NID_private_key_usage_period, 0, ASN1_ITEM_ref(PKEY_USAGE_PERIOD),
|
|
|
|
0, 0, 0, 0,
|
|
|
|
0, 0, 0, 0,
|
|
|
|
(X509V3_EXT_I2R)i2r_PKEY_USAGE_PERIOD, NULL,
|
|
|
|
NULL
|
1999-02-17 23:21:01 +00:00
|
|
|
};
|
|
|
|
|
2000-12-08 19:09:35 +00:00
|
|
|
ASN1_SEQUENCE(PKEY_USAGE_PERIOD) = {
|
2015-01-22 03:40:55 +00:00
|
|
|
ASN1_IMP_OPT(PKEY_USAGE_PERIOD, notBefore, ASN1_GENERALIZEDTIME, 0),
|
|
|
|
ASN1_IMP_OPT(PKEY_USAGE_PERIOD, notAfter, ASN1_GENERALIZEDTIME, 1)
|
2001-02-23 12:47:06 +00:00
|
|
|
} ASN1_SEQUENCE_END(PKEY_USAGE_PERIOD)
|
1999-02-17 23:21:01 +00:00
|
|
|
|
2000-12-08 19:09:35 +00:00
|
|
|
IMPLEMENT_ASN1_FUNCTIONS(PKEY_USAGE_PERIOD)
|
1999-02-17 23:21:01 +00:00
|
|
|
|
1999-04-19 21:31:43 +00:00
|
|
|
static int i2r_PKEY_USAGE_PERIOD(X509V3_EXT_METHOD *method,
|
2015-01-22 03:40:55 +00:00
|
|
|
PKEY_USAGE_PERIOD *usage, BIO *out,
|
|
|
|
int indent)
|
1999-02-17 23:21:01 +00:00
|
|
|
{
|
2015-01-22 03:40:55 +00:00
|
|
|
BIO_printf(out, "%*s", indent, "");
|
|
|
|
if (usage->notBefore) {
|
|
|
|
BIO_write(out, "Not Before: ", 12);
|
|
|
|
ASN1_GENERALIZEDTIME_print(out, usage->notBefore);
|
|
|
|
if (usage->notAfter)
|
|
|
|
BIO_write(out, ", ", 2);
|
|
|
|
}
|
|
|
|
if (usage->notAfter) {
|
|
|
|
BIO_write(out, "Not After: ", 11);
|
|
|
|
ASN1_GENERALIZEDTIME_print(out, usage->notAfter);
|
|
|
|
}
|
|
|
|
return 1;
|
1999-02-17 23:21:01 +00:00
|
|
|
}
|
|
|
|
|
2015-01-05 00:34:00 +00:00
|
|
|
/*-
|
1999-02-17 23:21:01 +00:00
|
|
|
static PKEY_USAGE_PERIOD *v2i_PKEY_USAGE_PERIOD(method, ctx, values)
|
|
|
|
X509V3_EXT_METHOD *method;
|
|
|
|
X509V3_CTX *ctx;
|
1999-06-21 23:59:09 +00:00
|
|
|
STACK_OF(CONF_VALUE) *values;
|
1999-02-17 23:21:01 +00:00
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
1999-02-21 20:01:39 +00:00
|
|
|
*/
|