public static function sign(
        string $message,
        SignatureSecretKey $privateKey,
        $encoding = Halite::ENCODE_BASE64URLSAFE
    ): string {
        $signed = \sodium_crypto_sign_detached(
            $message,
            $privateKey->getRawKeyMaterial()
        );
        $encoder = Halite::chooseEncoder($encoding);
        if ($encoder) {
            return (string) $encoder($signed);
        }
        return (string) $signed;
    }
public static function sign(
        string $message,
        SignatureSecretKey $privateKey,
        $encoding = Halite::ENCODE_BASE64URLSAFE
    ): string {
        $signed = \sodium_crypto_sign_detached(
            $message,
            $privateKey->getRawKeyMaterial()
        );
        $encoder = Halite::chooseEncoder($encoding);
        if ($encoder) {
            return (string) $encoder($signed);
        }
        return (string) $signed;
    }
public static function sign ( string $ message , SignatureSecretKey $ privateKey , $ encoding = Halite :: ENCODE_BASE64URLSAFE ) : string { $ signed = \ sodium_crypto_sign_detached ( $ message , $ privateKey -> getRawKeyMaterial ( ) ) ; $ encoder = Halite :: chooseEncoder ( $ encoding ) ; if ( $ encoder ) { return ( string ) $ encoder ( $ signed ) ; } return ( string ) $ signed ; }
Sign a message with our private key

@param string $message                Message to sign
@param SignatureSecretKey $privateKey Private signing key
@param mixed $encoding                Which encoding scheme to use?
@return string Signature (detached)

@throws InvalidType
@throws \TypeError
Sign a message with our private key