def sign(mechanism, key, data=nil, &block)
      common_crypt(:C_SignInit, :C_SignUpdate, :C_SignFinal, :C_Sign,
                   mechanism, key, data, &block)
    end
def sign(mechanism, key, data=nil, &block)
      common_crypt(:C_SignInit, :C_SignUpdate, :C_SignFinal, :C_Sign,
                   mechanism, key, data, &block)
    end
Convenience method for the {Session#C_SignInit}, {Session#C_SignUpdate}, {Session#C_SignFinal} call flow.

 @param [Hash, Symbol, Integer, PKCS11::CK_MECHANISM] mechanism  used mechanism
 @param [PKCS11::Object] key  used key
 @param [String] data  data to sign
 @yield [PKCS11::Session::Cipher]  Cipher object for processing data parts
 @return [String]  signature
 @see Session#encrypt
 @example Sign a text by a RSA private key
     signature = session.sign( :SHA1_RSA_PKCS, rsa_priv_key, "important text")