{"action":"created","issue":{"url":"https://api.github.com/repos/kislyuk/signxml/issues/28","labels_url":"https://api.github.com/repos/kislyuk/signxml/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/kislyuk/signxml/issues/28/comments","events_url":"https://api.github.com/repos/kislyuk/signxml/issues/28/events","html_url":"https://github.com/kislyuk/signxml/issues/28","id":109702221,"number":28,"title":"Api cosmetics","user":{"login":"pulina","id":6135155,"avatar_url":"https://avatars.githubusercontent.com/u/6135155?v=3","gravatar_id":"","url":"https://api.github.com/users/pulina","html_url":"https://github.com/pulina","followers_url":"https://api.github.com/users/pulina/followers","following_url":"https://api.github.com/users/pulina/following{/other_user}","gists_url":"https://api.github.com/users/pulina/gists{/gist_id}","starred_url":"https://api.github.com/users/pulina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pulina/subscriptions","organizations_url":"https://api.github.com/users/pulina/orgs","repos_url":"https://api.github.com/users/pulina/repos","events_url":"https://api.github.com/users/pulina/events{/privacy}","received_events_url":"https://api.github.com/users/pulina/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-04T20:19:56Z","updated_at":"2015-10-31T15:43:51Z","closed_at":null,"body":"Now the signxml object give ability to sign and verify bunch of data pass in constructor argument. Method, algorithm, cert and rest stuff are pass as argument specific method. There Is no option to  sign or verify without creating an object. Why not create simple interface like:\r\n\r\n```python\r\nsign(data, method, algorithm, key, passphrase, cert, c14n_algorithm, reference_uri, digest_algorithm)\r\n```\r\nor use pre-created obj to keep more accurate parameters. In most situation I sign and verify many  different bunch of data with same algorithm and keys. Maybe keep those parameters in fabric object and passing data direct to sign(or veryfi) method. It more intuitive. \r\n\r\n```python\r\nsigner_obj = signxml.xmldsig( algorithm, key, passphrase, cert)\r\nconfirmatory_obj = signxml.xmldsig( algorithm, key_pub)\r\nsigned_data1 = signer_obj.sign(data1, method)\r\nsigned_data2 = signer_obj.sign(data2, method)\r\nsigned_data3 = signer_obj.sign(data3, method)\r\n(send_message and get response ...)\r\nif confirmatory_obj.veryfi(response) != get_predicted_signed_part(reponse):\r\n    raise SomeException()\r\n```"},"comment":{"url":"https://api.github.com/repos/kislyuk/signxml/issues/comments/152744439","html_url":"https://github.com/kislyuk/signxml/issues/28#issuecomment-152744439","issue_url":"https://api.github.com/repos/kislyuk/signxml/issues/28","id":152744439,"user":{"login":"kislyuk","id":862013,"avatar_url":"https://avatars.githubusercontent.com/u/862013?v=3","gravatar_id":"","url":"https://api.github.com/users/kislyuk","html_url":"https://github.com/kislyuk","followers_url":"https://api.github.com/users/kislyuk/followers","following_url":"https://api.github.com/users/kislyuk/following{/other_user}","gists_url":"https://api.github.com/users/kislyuk/gists{/gist_id}","starred_url":"https://api.github.com/users/kislyuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kislyuk/subscriptions","organizations_url":"https://api.github.com/users/kislyuk/orgs","repos_url":"https://api.github.com/users/kislyuk/repos","events_url":"https://api.github.com/users/kislyuk/events{/privacy}","received_events_url":"https://api.github.com/users/kislyuk/received_events","type":"User","site_admin":false},"created_at":"2015-10-31T15:43:51Z","updated_at":"2015-10-31T15:43:51Z","body":"I am very much open to restructuring the API toward this model (where the constructor only takes settings that it makes sense to apply to multiple invocations, while the sign and verify methods are functional/idempotent and take the data input as the first argument).\r\n\r\nI'm afraid I don't have the time to do this right now, but contributions on this are very welcome."}}