pub struct ProfileKeys { /* private fields */ }Expand description
A profile key pair: what the Minecraft services issue for signed chat (valid for about two
days; vanilla fetches a new one once ProfileKeys::due_refresh).
Debug does not print the private key.
Implementations§
Source§impl ProfileKeys
impl ProfileKeys
Sourcepub fn from_der(
private_pkcs8: &[u8],
public_spki: &[u8],
key_signature: Vec<u8>,
expires_at: SystemTime,
refreshed_after: SystemTime,
) -> Result<ProfileKeys, ChatKeyError>
pub fn from_der( private_pkcs8: &[u8], public_spki: &[u8], key_signature: Vec<u8>, expires_at: SystemTime, refreshed_after: SystemTime, ) -> Result<ProfileKeys, ChatKeyError>
A key pair from its parts: the PKCS#8 DER private key, the DER SubjectPublicKeyInfo
public key, the services’ signature over the public key (publicKeySignatureV2), when
it expires and when it should be refreshed.
Sourcepub fn public_key_der(&self) -> &[u8] ⓘ
pub fn public_key_der(&self) -> &[u8] ⓘ
The public key as DER SubjectPublicKeyInfo (sent in chat_session_update).
Sourcepub fn key_signature(&self) -> &[u8] ⓘ
pub fn key_signature(&self) -> &[u8] ⓘ
The services’ signature over the profile id, the expiry and the public key.
Sourcepub fn expires_at(&self) -> SystemTime
pub fn expires_at(&self) -> SystemTime
When the key expires (servers refuse it afterwards).
Sourcepub fn expires_at_millis(&self) -> i64
pub fn expires_at_millis(&self) -> i64
The expiry in milliseconds since the Unix epoch (its wire form).
Sourcepub fn refreshed_after(&self) -> SystemTime
pub fn refreshed_after(&self) -> SystemTime
When the services want the key replaced.
Sourcepub fn due_refresh(&self) -> bool
pub fn due_refresh(&self) -> bool
ProfileKeyPair.dueRefresh: the refresh time has passed.
Sourcepub fn expires_within(&self, margin: Duration) -> bool
pub fn expires_within(&self, margin: Duration) -> bool
The key has expired (or does so within margin).
Sourcepub fn signature_len(&self) -> usize
pub fn signature_len(&self) -> usize
The signature length in bytes (the modulus size; 256 for the services’ 2048-bit keys).
Trait Implementations§
Source§impl Clone for ProfileKeys
impl Clone for ProfileKeys
Source§fn clone(&self) -> ProfileKeys
fn clone(&self) -> ProfileKeys
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more