Struct ruma_signatures::Signature
[−]
[src]
pub struct Signature { /* fields omitted */ }
A digital signature.
Methods
impl Signature
[src]
fn new(id: &str, bytes: &[u8]) -> Result<Self, Error>
Creates a signature from raw bytes.
Parameters
- id: A key identifier, e.g. "ed25519:1".
- bytes: The digital signature, as a series of bytes.
Errors
Returns an error if the key identifier is invalid.
fn algorithm(&self) -> Algorithm
The algorithm used to generate the signature.
fn as_bytes(&self) -> &[u8]
The raw bytes of the signature.
fn base64(&self) -> String
A Base64 encoding of the signature.
fn id(&self) -> String
The key identifier, a string containing the signature algorithm and the key "version" separated by a colon, e.g. "ed25519:1".
fn version(&self) -> &str
The "version" of the key used for this signature.
Versions are used as an identifier to distinguish signatures generated from different keys but using the same algorithm on the same homeserver.
Trait Implementations
impl Clone for Signature
[src]
fn clone(&self) -> Signature
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for Signature
[src]
impl Eq for Signature
[src]
impl Hash for Signature
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the state given, updating the hasher as necessary.
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the state provided.