def C_GenerateKeyPair(mechanism, pubkey_template={}, privkey_template={})
      objs = @pk.C_GenerateKeyPair(@sess, to_mechanism(mechanism), to_attributes(pubkey_template), to_attributes(privkey_template))
      objs.map{|obj| Object.new @pk, @sess, obj }
    end
def C_GenerateKeyPair(mechanism, pubkey_template={}, privkey_template={})
      objs = @pk.C_GenerateKeyPair(@sess, to_mechanism(mechanism), to_attributes(pubkey_template), to_attributes(privkey_template))
      objs.map{|obj| Object.new @pk, @sess, obj }
    end
Generates a public/private key pair, creating new key Object instances.

 @param [Hash, Symbol, Integer, PKCS11::CK_MECHANISM] mechanism  used mechanism
 @param [Hash] pubkey_template  Attributes of the public key to create.
 @param [Hash] privkey_template  Attributes of the private key to create.
 @return [Array<PKCS11::Object>]  an two-items array of new created public and private key Object.
 @example
     pub_key, priv_key = session.generate_key_pair(:RSA_PKCS_KEY_PAIR_GEN,
       {:ENCRYPT=>true, :VERIFY=>true, :WRAP=>true, :MODULUS_BITS=>768, :PUBLIC_EXPONENT=>3},
       {:SUBJECT=>'test', :ID=>"ID", :DECRYPT=>true, :SIGN=>true, :UNWRAP=>true})