2016-05-17 18:51:34 +00:00
|
|
|
/*
|
|
|
|
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
|
1998-12-21 10:52:47 +00:00
|
|
|
*
|
2016-05-17 18:51:34 +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
|
1998-12-21 10:52:47 +00:00
|
|
|
*/
|
|
|
|
|
2016-01-31 18:08:23 +00:00
|
|
|
#include "openssl/opensslconf.h"
|
|
|
|
#ifdef OPENSSL_NO_RSA
|
|
|
|
NON_EMPTY_TRANSLATION_UNIT
|
|
|
|
#else
|
|
|
|
|
|
|
|
# include "internal/cryptlib.h"
|
|
|
|
# include <stdio.h>
|
2015-01-22 03:40:55 +00:00
|
|
|
# include <openssl/rsa.h>
|
|
|
|
# include <openssl/objects.h>
|
|
|
|
# include <openssl/asn1t.h>
|
|
|
|
# include <openssl/evp.h>
|
|
|
|
# include <openssl/x509.h>
|
|
|
|
|
|
|
|
# ifndef OPENSSL_NO_RC4
|
|
|
|
|
|
|
|
typedef struct netscape_pkey_st {
|
2017-04-05 11:24:14 +00:00
|
|
|
int32_t version;
|
2015-01-22 03:40:55 +00:00
|
|
|
X509_ALGOR *algor;
|
|
|
|
ASN1_OCTET_STRING *private_key;
|
|
|
|
} NETSCAPE_PKEY;
|
|
|
|
|
|
|
|
typedef struct netscape_encrypted_pkey_st {
|
|
|
|
ASN1_OCTET_STRING *os;
|
|
|
|
/*
|
|
|
|
* This is the same structure as DigestInfo so use it: although this
|
|
|
|
* isn't really anything to do with digests.
|
|
|
|
*/
|
|
|
|
X509_SIG *enckey;
|
|
|
|
} NETSCAPE_ENCRYPTED_PKEY;
|
2000-12-08 19:09:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
ASN1_BROKEN_SEQUENCE(NETSCAPE_ENCRYPTED_PKEY) = {
|
2015-01-22 03:40:55 +00:00
|
|
|
ASN1_SIMPLE(NETSCAPE_ENCRYPTED_PKEY, os, ASN1_OCTET_STRING),
|
|
|
|
ASN1_SIMPLE(NETSCAPE_ENCRYPTED_PKEY, enckey, X509_SIG)
|
2015-09-05 12:32:58 +00:00
|
|
|
} static_ASN1_BROKEN_SEQUENCE_END(NETSCAPE_ENCRYPTED_PKEY)
|
2000-12-08 19:09:35 +00:00
|
|
|
|
2002-06-14 19:01:52 +00:00
|
|
|
DECLARE_ASN1_FUNCTIONS_const(NETSCAPE_ENCRYPTED_PKEY)
|
|
|
|
DECLARE_ASN1_ENCODE_FUNCTIONS_const(NETSCAPE_ENCRYPTED_PKEY,NETSCAPE_ENCRYPTED_PKEY)
|
2000-12-08 19:09:35 +00:00
|
|
|
IMPLEMENT_ASN1_FUNCTIONS_const(NETSCAPE_ENCRYPTED_PKEY)
|
|
|
|
|
|
|
|
ASN1_SEQUENCE(NETSCAPE_PKEY) = {
|
2017-04-12 09:52:52 +00:00
|
|
|
ASN1_EMBED(NETSCAPE_PKEY, version, INT32),
|
2015-01-22 03:40:55 +00:00
|
|
|
ASN1_SIMPLE(NETSCAPE_PKEY, algor, X509_ALGOR),
|
|
|
|
ASN1_SIMPLE(NETSCAPE_PKEY, private_key, ASN1_OCTET_STRING)
|
2015-09-05 12:32:58 +00:00
|
|
|
} static_ASN1_SEQUENCE_END(NETSCAPE_PKEY)
|
2000-12-08 19:09:35 +00:00
|
|
|
|
2002-06-14 19:01:52 +00:00
|
|
|
DECLARE_ASN1_FUNCTIONS_const(NETSCAPE_PKEY)
|
|
|
|
DECLARE_ASN1_ENCODE_FUNCTIONS_const(NETSCAPE_PKEY,NETSCAPE_PKEY)
|
2000-12-08 19:09:35 +00:00
|
|
|
IMPLEMENT_ASN1_FUNCTIONS_const(NETSCAPE_PKEY)
|
|
|
|
|
2015-01-22 03:40:55 +00:00
|
|
|
# endif /* OPENSSL_NO_RC4 */
|
|
|
|
|
1999-04-27 01:14:46 +00:00
|
|
|
#endif
|