aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRenĂ© Meusel <[email protected]>2022-02-03 08:46:48 +0100
committerRenĂ© Meusel <[email protected]>2022-02-03 08:46:48 +0100
commit32b0304b908d5beaffedc5d22235e80adcd38a19 (patch)
treea27aba69c68869f24457ef44074a93b4063b6de0 /src
parentcd19d83cb8a639fd9dfcd1f8f6538c82f8a7b33b (diff)
allow setting the public point encoding of a P11 ECC private key
See GH #2885 for further details
Diffstat (limited to 'src')
-rw-r--r--src/lib/prov/pkcs11/p11_ecc_key.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/prov/pkcs11/p11_ecc_key.h b/src/lib/prov/pkcs11/p11_ecc_key.h
index e2fd35b1a..46e24439d 100644
--- a/src/lib/prov/pkcs11/p11_ecc_key.h
+++ b/src/lib/prov/pkcs11/p11_ecc_key.h
@@ -176,6 +176,16 @@ class BOTAN_PUBLIC_API(2,0) PKCS11_EC_PrivateKey : public virtual Private_Key,
}
/**
+ * Sets the public desired public point encoding of this private key, when it is passed to cryptoki functions.
+ * This could be either `PublicPointEncoding::Raw` or `PublicPointEncoding::Der`. By default this is set to `Der`,
+ * but some tokens might expect `Raw`-encoded public keys, e.g. when using this private key for key agreement.
+ */
+ void set_point_encoding(PublicPointEncoding point_encoding)
+ {
+ m_point_encoding = point_encoding;
+ }
+
+ /**
* Gets the public_point
* @note the public key must be set using `set_public_point`
* because it is not possible to infer the public key from a PKCS#11 EC private key