ESP-IDF
ot::Crypto::Ecdsa::P256::PublicKey
is only used within ESP-IDF.
Symbol previews are coming soon...
Symbols
loading...
Files
loading...
Summary
Syntax
Methods
Related
Examples
References
Call Tree
Data Use
Class Tree
Override Tree
Implementations
Instances
Lifecycle
SourceVu
ESP-IDF Framework and Examples
ESP-IDF
ot::Crypto::Ecdsa::P256::PublicKey
ot::Crypto::Ecdsa::P256::PublicKey class
Syntax
Show:
Summary
Declaration
Definition
from
ecdsa.hpp:76
class
PublicKey
;
class
KeyPair
;
#if
OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE
class
KeyPairAsRef
;
#endif
OT_TOOL_PACKED_BEGIN
class
Signature
:
public
otPlatCryptoEcdsaSignature
{
friend
class
KeyPair
;
friend
class
PublicKey
;
#if
OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE
friend
class
KeyPairAsRef
;
#endif
public
:
static
constexpr
uint8_t
kSize
=
OT_CRYPTO_ECDSA_SIGNATURE_SIZE
;
const
uint8_t
*
GetBytes
(
void
)
const
{
return
m8
;
}
}
OT_TOOL_PACKED_END
;
class
KeyPair
:
public
otPlatCryptoEcdsaKeyPair
{
public
:
static
constexpr
uint8_t
kMaxDerSize
=
OT_CRYPTO_ECDSA_MAX_DER_SIZE
;
KeyPair
(
void
)
{
mDerLength
=
0
;
}
Error
Generate
(
void
)
{
return
otPlatCryptoEcdsaGenerateKey
(
this
)
;
}
Error
GetPublicKey
(
PublicKey
&
aPublicKey
)
const
{
return
otPlatCryptoEcdsaGetPublicKey
(
this
,
&
aPublicKey
)
;
}
const
uint8_t
*
GetDerBytes
(
void
)
const
{
return
mDerBytes
;
}
uint8_t
GetDerLength
(
void
)
const
{
return
mDerLength
;
}
uint8_t
*
GetDerBytes
(
void
)
{
return
mDerBytes
;
}
void
SetDerLength
(
uint8_t
aDerLength
)
{
mDerLength
=
aDerLength
;
}
Error
Sign
(
const
Sha256
::
Hash
&
aHash
,
Signature
&
aSignature
)
const
{
return
otPlatCryptoEcdsaSign
(
this
,
&
aHash
,
&
aSignature
)
;
}
}
;
#if
OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE
class
KeyPairAsRef
{
public
:
explicit
KeyPairAsRef
(
otCryptoKeyRef
aKeyRef
=
0
)
{
mKeyRef
=
aKeyRef
;
}
Error
Generate
(
void
)
const
{
return
otPlatCryptoEcdsaGenerateAndImportKey
(
mKeyRef
)
;
}
Error
ImportKeyPair
(
const
KeyPair
&
aKeyPair
)
{
return
Crypto
::
Storage
::
ImportKey
(
mKeyRef
,
Storage
::
kKeyTypeEcdsa
,
Storage
::
kKeyAlgorithmEcdsa
,
(
Storage
::
kUsageSignHash
|
Storage
::
kUsageVerifyHash
)
,
Storage
::
kTypePersistent
,
aKeyPair
.
GetDerBytes
(
)
,
aKeyPair
.
GetDerLength
(
)
)
;
}
Error
GetPublicKey
(
PublicKey
&
aPublicKey
)
const
{
return
otPlatCryptoEcdsaExportPublicKey
(
mKeyRef
,
&
aPublicKey
)
;
}
Error
Sign
(
const
Sha256
::
Hash
&
aHash
,
Signature
&
aSignature
)
const
{
return
otPlatCryptoEcdsaSignUsingKeyRef
(
mKeyRef
,
&
aHash
,
&
aSignature
)
;
}
otCryptoKeyRef
GetKeyRef
(
void
)
const
{
return
mKeyRef
;
}
void
SetKeyRef
(
otCryptoKeyRef
aKeyRef
)
{
mKeyRef
=
aKeyRef
;
}
private
:
otCryptoKeyRef
mKeyRef
;
}
;
#endif
OT_TOOL_PACKED_BEGIN
class
PublicKey
:
public
otPlatCryptoEcdsaPublicKey
;
Implemented in
ecdsa.hpp:297
Fields
Field
ot::Crypto::Ecdsa::P256::PublicKey::kSize
Methods
GetBytes() const
Gets the pointer to the buffer containing the public key (as an uncompressed curve point).
Verify() const
Uses the `PublicKey` to verify the ECDSA signature of a hashed message.
Related Functions
Found 3 other functions taking a
PublicKey
argument:
Function
Description
ot::Crypto::Ecdsa::P256::KeyPair::GetPublicKey() const
Gets the associated public key from the `KeyPair`.
ot::Srp::Server::VerifySignature() const
ot::Dns::Ecdsa256KeyRecord::SetKey()
Sets the ECDSA P-256 public key.
Examples
References
from
examples
Call Tree
from
examples
All items filtered out
All items filtered out
Data Use
from
examples
All items filtered out
All items filtered out
Class Tree
from
examples
All items filtered out
All items filtered out
Override Tree
from
examples
All items filtered out
All items filtered out
Implementations
from
examples
All items filtered out
All items filtered out
Instances
from
examples
Lifecycle
from
examples
All items filtered out
All items filtered out