pub struct RpkKeyDef<PK: KeyComponent<Rpk>, SK: KeyComponent<Rpk>> { /* private fields */ }
Expand description
Key definition for a DTLS key consisting of a private and public key component without a signed certificate.
§Note on key construction
For maximum compatibility, you should stick to the with_*
constructors defined for this type.
While in theory you could use an arbitrary combination of key component types for a key
definition, those defined using with_*
match explicit key types provided in libcoap and should
therefore always be supported.
Implementations§
Source§impl<PK: KeyComponent<Rpk>, SK: KeyComponent<Rpk>> RpkKeyDef<PK, SK>
impl<PK: KeyComponent<Rpk>, SK: KeyComponent<Rpk>> RpkKeyDef<PK, SK>
Sourcepub fn new(
public_key: PK,
private_key: SK,
user_pin: Option<CString>,
asn1_private_key_type: Asn1PrivateKeyType,
) -> Self
pub fn new( public_key: PK, private_key: SK, user_pin: Option<CString>, asn1_private_key_type: Asn1PrivateKeyType, ) -> Self
Creates a new key definition using the given components.
§Parameters
public_key
: The public key component of this key.private_key
: The private key.user_pin
: The PIN that should be used when unlocking a token (for PKCS11 keys stored on a token, ignored otherwise)asn1_private_key_type
: The type of the private key (only used for DER/ASN.1 encoded keys).
Source§impl RpkKeyDef<PemMemoryKeyComponent, PemMemoryKeyComponent>
impl RpkKeyDef<PemMemoryKeyComponent, PemMemoryKeyComponent>
Sourcepub fn with_pem_memory(
public_key: impl Into<PemMemoryKeyComponent>,
private_key: impl Into<PemMemoryKeyComponent>,
) -> Self
pub fn with_pem_memory( public_key: impl Into<PemMemoryKeyComponent>, private_key: impl Into<PemMemoryKeyComponent>, ) -> Self
Creates a new key definition using PEM-encoded byte sequences in memory as components.
See the documentation of RpkKeyDef::new
for more information on the parameters.
Source§impl RpkKeyDef<Pkcs11KeyComponent, Pkcs11KeyComponent>
impl RpkKeyDef<Pkcs11KeyComponent, Pkcs11KeyComponent>
Sourcepub fn with_pkcs11(
public_key: impl Into<Pkcs11KeyComponent>,
private_key: impl Into<Pkcs11KeyComponent>,
user_pin: Option<CString>,
) -> Self
pub fn with_pkcs11( public_key: impl Into<Pkcs11KeyComponent>, private_key: impl Into<Pkcs11KeyComponent>, user_pin: Option<CString>, ) -> Self
Creates a new key definition using PKCS11 URIs as components.
See the documentation of RpkKeyDef::new
for more information on the parameters.