2 * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
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
10 #include "openssl/opensslconf.h"
12 NON_EMPTY_TRANSLATION_UNIT
15 # include "internal/cryptlib.h"
17 # include <openssl/rsa.h>
18 # include <openssl/objects.h>
19 # include <openssl/asn1t.h>
20 # include <openssl/evp.h>
21 # include <openssl/x509.h>
23 # ifndef OPENSSL_NO_RC4
25 typedef struct netscape_pkey_st {
28 ASN1_OCTET_STRING *private_key;
31 typedef struct netscape_encrypted_pkey_st {
32 ASN1_OCTET_STRING *os;
34 * This is the same structure as DigestInfo so use it: although this
35 * isn't really anything to do with digests.
38 } NETSCAPE_ENCRYPTED_PKEY;
41 ASN1_BROKEN_SEQUENCE(NETSCAPE_ENCRYPTED_PKEY) = {
42 ASN1_SIMPLE(NETSCAPE_ENCRYPTED_PKEY, os, ASN1_OCTET_STRING),
43 ASN1_SIMPLE(NETSCAPE_ENCRYPTED_PKEY, enckey, X509_SIG)
44 } static_ASN1_BROKEN_SEQUENCE_END(NETSCAPE_ENCRYPTED_PKEY)
46 DECLARE_ASN1_FUNCTIONS_const(NETSCAPE_ENCRYPTED_PKEY)
47 DECLARE_ASN1_ENCODE_FUNCTIONS_const(NETSCAPE_ENCRYPTED_PKEY,NETSCAPE_ENCRYPTED_PKEY)
48 IMPLEMENT_ASN1_FUNCTIONS_const(NETSCAPE_ENCRYPTED_PKEY)
50 ASN1_SEQUENCE(NETSCAPE_PKEY) = {
51 ASN1_EMBED(NETSCAPE_PKEY, version, INT32),
52 ASN1_SIMPLE(NETSCAPE_PKEY, algor, X509_ALGOR),
53 ASN1_SIMPLE(NETSCAPE_PKEY, private_key, ASN1_OCTET_STRING)
54 } static_ASN1_SEQUENCE_END(NETSCAPE_PKEY)
56 DECLARE_ASN1_FUNCTIONS_const(NETSCAPE_PKEY)
57 DECLARE_ASN1_ENCODE_FUNCTIONS_const(NETSCAPE_PKEY,NETSCAPE_PKEY)
58 IMPLEMENT_ASN1_FUNCTIONS_const(NETSCAPE_PKEY)
60 # endif /* OPENSSL_NO_RC4 */