pub fn sign(self, data: &[u8], secret: &Secret) -> Result<Vec<u8>, Error> {
        use self::SignatureAlgorithm::*;

        match self {
            None => Self::sign_none(secret),
            HS256 | HS384 | HS512 => Self::sign_hmac(data, secret, self),
            RS256 | RS384 | RS512 | PS256 | PS384 | PS512 => Self::sign_rsa(data, secret, self),
            ES256 | ES384 | ES512 => Self::sign_ecdsa(data, secret, self),
        }
    }
/// Take some bytes and sign it according to the algorithm and secret provided.
Take some bytes and sign it according to the algorithm and secret provided.
Take some bytes and sign it according to the algorithm and secret provided .
pub fn sign(self, data: &[u8], secret: &Secret) -> Result<Vec<u8>, Error> {
        use self::SignatureAlgorithm::*;
        match self {
            None => Self::sign_none(secret),
            HS256 | HS384 | HS512 => Self::sign_hmac(data, secret, self),
            RS256 | RS384 | RS512 | PS256 | PS384 | PS512 => Self::sign_rsa(data, secret, self),
            ES256 | ES384 | ES512 => Self::sign_ecdsa(data, secret, self),
        }
    }
pub fn sign ( self , data : & [ u8 ] , secret : & Secret ) -> Result < Vec < u8 > , Error > { use self :: SignatureAlgorithm :: * ; match self { None => Self :: sign_none ( secret ) , HS256 | HS384 | HS512 => Self :: sign_hmac ( data , secret , self ) , RS256 | RS384 | RS512 | PS256 | PS384 | PS512 => Self :: sign_rsa ( data , secret , self ) , ES256 | ES384 | ES512 => Self :: sign_ecdsa ( data , secret , self ) , } }
Take some bytes and sign it according to the algorithm and secret provided.
Take some bytes and sign it according to the algorithm and secret provided .
self
data
&[u8]
secret
&Secret
self
data
&[u8]
secret
&Secret