X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=include%2Fcrypto%2Fasn1.h;h=d3683649bc1cee310702b64a0a8a3c5a2be21500;hp=674fa704a1655dabdf513f62d3d11f2fa5860ced;hb=7674e92324648b59786d86d8e9014bbaed4e6d07;hpb=25f2138b0ab54a65ba713c093ca3734d88f7cb51 diff --git a/include/crypto/asn1.h b/include/crypto/asn1.h index 674fa704a1..d3683649bc 100644 --- a/include/crypto/asn1.h +++ b/include/crypto/asn1.h @@ -1,5 +1,5 @@ /* - * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2015-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -11,13 +11,15 @@ /* ASN1 public key method structure */ +#include + struct evp_pkey_asn1_method_st { int pkey_id; int pkey_base_id; unsigned long pkey_flags; char *pem_str; char *info; - int (*pub_decode) (EVP_PKEY *pk, X509_PUBKEY *pub); + int (*pub_decode) (EVP_PKEY *pk, const X509_PUBKEY *pub); int (*pub_encode) (X509_PUBKEY *pub, const EVP_PKEY *pk); int (*pub_cmp) (const EVP_PKEY *a, const EVP_PKEY *b); int (*pub_print) (BIO *out, const EVP_PKEY *pkey, int indent, @@ -68,9 +70,17 @@ struct evp_pkey_asn1_method_st { * TODO: Make sure these functions are defined for key types that are * implemented in providers. */ - /* Exports to providers */ + /* Exports and imports to / from providers */ size_t (*dirty_cnt) (const EVP_PKEY *pk); - void *(*export_to) (const EVP_PKEY *pk, EVP_KEYMGMT *keymgmt); + int (*export_to) (const EVP_PKEY *pk, void *to_keydata, + EVP_KEYMGMT *to_keymgmt, OPENSSL_CTX *libctx, + const char *propq); + OSSL_CALLBACK *import_from; + + int (*priv_decode_with_libctx) (EVP_PKEY *pk, + const PKCS8_PRIV_KEY_INFO *p8inf, + OPENSSL_CTX *libctx, + const char *propq); } /* EVP_PKEY_ASN1_METHOD */ ; DEFINE_STACK_OF_CONST(EVP_PKEY_ASN1_METHOD)