]>
Commit | Line | Data |
---|---|---|
d3819813 | 1 | /* |
7bf7a6d0 | 2 | * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved. |
3e575651 | 3 | * |
7bf7a6d0 MTL |
4 | * Licensed under the OpenSSL license (the "License"). You may not use |
5 | * this file except in compliance with the License. You can obtain a copy | |
6 | * in the file LICENSE in the source distribution or at | |
7 | * https://www.openssl.org/source/license.html | |
3e575651 SL |
8 | */ |
9 | ||
10 | #include <stdio.h> | |
7bf7a6d0 | 11 | #include "internal/cryptlib.h" |
3e575651 SL |
12 | #include <openssl/asn1.h> |
13 | #include <openssl/asn1t.h> | |
14 | #include <openssl/x509v3.h> | |
7bf7a6d0 | 15 | #include "ext_dat.h" |
3e575651 | 16 | |
d3819813 MTL |
17 | static int i2r_PKEY_USAGE_PERIOD(X509V3_EXT_METHOD *method, |
18 | PKEY_USAGE_PERIOD *usage, BIO *out, | |
19 | int indent); | |
3e575651 | 20 | /* |
d3819813 MTL |
21 | * static PKEY_USAGE_PERIOD *v2i_PKEY_USAGE_PERIOD(X509V3_EXT_METHOD *method, |
22 | * X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *values); | |
23 | */ | |
3e575651 | 24 | const X509V3_EXT_METHOD v3_pkey_usage_period = { |
d3819813 MTL |
25 | NID_private_key_usage_period, 0, ASN1_ITEM_ref(PKEY_USAGE_PERIOD), |
26 | 0, 0, 0, 0, | |
27 | 0, 0, 0, 0, | |
28 | (X509V3_EXT_I2R)i2r_PKEY_USAGE_PERIOD, NULL, | |
29 | NULL | |
3e575651 SL |
30 | }; |
31 | ||
32 | ASN1_SEQUENCE(PKEY_USAGE_PERIOD) = { | |
d3819813 MTL |
33 | ASN1_IMP_OPT(PKEY_USAGE_PERIOD, notBefore, ASN1_GENERALIZEDTIME, 0), |
34 | ASN1_IMP_OPT(PKEY_USAGE_PERIOD, notAfter, ASN1_GENERALIZEDTIME, 1) | |
3e575651 SL |
35 | } ASN1_SEQUENCE_END(PKEY_USAGE_PERIOD) |
36 | ||
37 | IMPLEMENT_ASN1_FUNCTIONS(PKEY_USAGE_PERIOD) | |
38 | ||
39 | static int i2r_PKEY_USAGE_PERIOD(X509V3_EXT_METHOD *method, | |
d3819813 MTL |
40 | PKEY_USAGE_PERIOD *usage, BIO *out, |
41 | int indent) | |
3e575651 | 42 | { |
d3819813 MTL |
43 | BIO_printf(out, "%*s", indent, ""); |
44 | if (usage->notBefore) { | |
45 | BIO_write(out, "Not Before: ", 12); | |
46 | ASN1_GENERALIZEDTIME_print(out, usage->notBefore); | |
47 | if (usage->notAfter) | |
48 | BIO_write(out, ", ", 2); | |
49 | } | |
50 | if (usage->notAfter) { | |
51 | BIO_write(out, "Not After: ", 11); | |
52 | ASN1_GENERALIZEDTIME_print(out, usage->notAfter); | |
53 | } | |
54 | return 1; | |
3e575651 SL |
55 | } |
56 | ||
d3819813 | 57 | /*- |
3e575651 SL |
58 | static PKEY_USAGE_PERIOD *v2i_PKEY_USAGE_PERIOD(method, ctx, values) |
59 | X509V3_EXT_METHOD *method; | |
60 | X509V3_CTX *ctx; | |
61 | STACK_OF(CONF_VALUE) *values; | |
62 | { | |
63 | return NULL; | |
64 | } | |
65 | */ |