pub struct Ed25519Credential { /* private fields */ }Expand description
Binance Ed25519 credentials for WebSocket API authentication.
Ed25519 is required for WebSocket API authentication (session.logon).
This is the only key type supported for execution clients.
Implementations§
Source§impl Ed25519Credential
impl Ed25519Credential
Sourcepub fn new(
api_key: String,
private_key_base64: &str,
) -> Result<Self, Ed25519CredentialError>
pub fn new( api_key: String, private_key_base64: &str, ) -> Result<Self, Ed25519CredentialError>
Creates a new Ed25519Credential from API key and base64-encoded private key.
The private key can be provided as:
- PKCS#8 DER format (48 bytes, as generated by OpenSSL)
- PEM format (with or without headers)
Raw 32-byte Ed25519 seeds (without PKCS#8 wrapping) are rejected: every 32-byte value is a mathematically valid seed, so accepting them would silently misclassify any base64-decodable HMAC secret as Ed25519.
For PKCS#8/PEM format, the 32-byte seed is extracted from the last 32 bytes.
§Errors
Returns an error if the private key is not valid base64, does not carry the Ed25519 PKCS#8 OID, or is shorter than 32 bytes after decoding.
Trait Implementations§
Source§impl Clone for Ed25519Credential
impl Clone for Ed25519Credential
Source§impl Debug for Ed25519Credential
impl Debug for Ed25519Credential
Auto Trait Implementations§
impl Freeze for Ed25519Credential
impl RefUnwindSafe for Ed25519Credential
impl Send for Ed25519Credential
impl Sync for Ed25519Credential
impl Unpin for Ed25519Credential
impl UnsafeUnpin for Ed25519Credential
impl UnwindSafe for Ed25519Credential
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more