{"action":"created","comment":{"url":"https://api.github.com/repos/treetopllc/xml/pulls/comments/75724576","id":75724576,"diff_hunk":"@@ -23,11 +23,59 @@ type DigitalSignature struct {\n }\n */\n \n+type SHAAlgorithm int\n+\n+const (\n+\tSHA0Algorithm SHAAlgorithm = iota\n+\tSHA1Algorithm\n+\tSHA224Algorithm\n+\tSHA256Algorithm\n+\tSHA384Algorithm\n+\tSHA512Algorithm\n+)\n+\n+type C14NAlgorithm int\n+\n+const (\n+\tC14NExclusive C14NAlgorithm = iota\n+\tC14NExclusiveWithComments\n+)\n+\n // DigitallySign a node in a document using the key and cert pem encoded data\n-func DigitallySign(doc *Document, node *Node, key []byte) error {\n+func DigitallySign(doc *Document, node *Node, key []byte,\n+\tshaAlgorithm SHAAlgorithm, c14nAlgorithm C14NAlgorithm) error {\n+\tvar signAlgorithm C.xmlShaAlgorithm\n+\tvar digestAlgorithm C.xmlShaAlgorithm\n+\tswitch shaAlgorithm {\n+\tcase SHA1Algorithm:\n+\t\tsignAlgorithm = C.XML_SHA1\n+\t\tdigestAlgorithm = C.XML_SHA1\n+\tcase SHA224Algorithm:\n+\t\tsignAlgorithm = C.XML_SHA224\n+\t\tdigestAlgorithm = C.XML_SHA224\n+\tcase SHA256Algorithm:\n+\t\tsignAlgorithm = C.XML_SHA256\n+\t\tdigestAlgorithm = C.XML_SHA256\n+\tcase SHA384Algorithm:\n+\t\tsignAlgorithm = C.XML_SHA384\n+\t\tdigestAlgorithm = C.XML_SHA384\n+\tcase SHA512Algorithm:\n+\t\tsignAlgorithm = C.XML_SHA512\n+\t\tdigestAlgorithm = C.XML_SHA512","path":"xml_dsig.go","position":43,"original_position":43,"commit_id":"f825e50bda7e6b2ef8dad2b976a46a825e09b44c","original_commit_id":"f825e50bda7e6b2ef8dad2b976a46a825e09b44c","user":{"login":"juniorrobot","id":127405,"avatar_url":"https://avatars.githubusercontent.com/u/127405?v=3","gravatar_id":"","url":"https://api.github.com/users/juniorrobot","html_url":"https://github.com/juniorrobot","followers_url":"https://api.github.com/users/juniorrobot/followers","following_url":"https://api.github.com/users/juniorrobot/following{/other_user}","gists_url":"https://api.github.com/users/juniorrobot/gists{/gist_id}","starred_url":"https://api.github.com/users/juniorrobot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juniorrobot/subscriptions","organizations_url":"https://api.github.com/users/juniorrobot/orgs","repos_url":"https://api.github.com/users/juniorrobot/repos","events_url":"https://api.github.com/users/juniorrobot/events{/privacy}","received_events_url":"https://api.github.com/users/juniorrobot/received_events","type":"User","site_admin":false},"body":"my thought was to let it 0-initialize and lead to an error so that the caller explicitly sets something valid. SHA-256 might be a sensible default, but who knows?","created_at":"2016-08-22T17:49:45Z","updated_at":"2016-08-22T17:49:45Z","html_url":"https://github.com/treetopllc/xml/pull/7#discussion_r75724576","pull_request_url":"https://api.github.com/repos/treetopllc/xml/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/treetopllc/xml/pulls/comments/75724576"},"html":{"href":"https://github.com/treetopllc/xml/pull/7#discussion_r75724576"},"pull_request":{"href":"https://api.github.com/repos/treetopllc/xml/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/treetopllc/xml/pulls/7","id":82229739,"html_url":"https://github.com/treetopllc/xml/pull/7","diff_url":"https://github.com/treetopllc/xml/pull/7.diff","patch_url":"https://github.com/treetopllc/xml/pull/7.patch","issue_url":"https://api.github.com/repos/treetopllc/xml/issues/7","number":7,"state":"open","locked":false,"title":"Alternate transform algorithms","user":{"login":"juniorrobot","id":127405,"avatar_url":"https://avatars.githubusercontent.com/u/127405?v=3","gravatar_id":"","url":"https://api.github.com/users/juniorrobot","html_url":"https://github.com/juniorrobot","followers_url":"https://api.github.com/users/juniorrobot/followers","following_url":"https://api.github.com/users/juniorrobot/following{/other_user}","gists_url":"https://api.github.com/users/juniorrobot/gists{/gist_id}","starred_url":"https://api.github.com/users/juniorrobot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juniorrobot/subscriptions","organizations_url":"https://api.github.com/users/juniorrobot/orgs","repos_url":"https://api.github.com/users/juniorrobot/repos","events_url":"https://api.github.com/users/juniorrobot/events{/privacy}","received_events_url":"https://api.github.com/users/juniorrobot/received_events","type":"User","site_admin":false},"body":"parameterize the algorithms used for signing documents","created_at":"2016-08-22T17:23:05Z","updated_at":"2016-08-22T17:49:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"682011b2b8f45c67e0fdfff8f37216bba30b3c7e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/treetopllc/xml/pulls/7/commits","review_comments_url":"https://api.github.com/repos/treetopllc/xml/pulls/7/comments","review_comment_url":"https://api.github.com/repos/treetopllc/xml/pulls/comments{/number}","comments_url":"https://api.github.com/repos/treetopllc/xml/issues/7/comments","statuses_url":"https://api.github.com/repos/treetopllc/xml/statuses/f825e50bda7e6b2ef8dad2b976a46a825e09b44c","head":{"label":"treetopllc:alt_transform_algos","ref":"alt_transform_algos","sha":"f825e50bda7e6b2ef8dad2b976a46a825e09b44c","user":{"login":"treetopllc","id":764597,"avatar_url":"https://avatars.githubusercontent.com/u/764597?v=3","gravatar_id":"","url":"https://api.github.com/users/treetopllc","html_url":"https://github.com/treetopllc","followers_url":"https://api.github.com/users/treetopllc/followers","following_url":"https://api.github.com/users/treetopllc/following{/other_user}","gists_url":"https://api.github.com/users/treetopllc/gists{/gist_id}","starred_url":"https://api.github.com/users/treetopllc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/treetopllc/subscriptions","organizations_url":"https://api.github.com/users/treetopllc/orgs","repos_url":"https://api.github.com/users/treetopllc/repos","events_url":"https://api.github.com/users/treetopllc/events{/privacy}","received_events_url":"https://api.github.com/users/treetopllc/received_events","type":"Organization","site_admin":false},"repo":{"id":22274968,"name":"xml","full_name":"treetopllc/xml","owner":{"login":"treetopllc","id":764597,"avatar_url":"https://avatars.githubusercontent.com/u/764597?v=3","gravatar_id":"","url":"https://api.github.com/users/treetopllc","html_url":"https://github.com/treetopllc","followers_url":"https://api.github.com/users/treetopllc/followers","following_url":"https://api.github.com/users/treetopllc/following{/other_user}","gists_url":"https://api.github.com/users/treetopllc/gists{/gist_id}","starred_url":"https://api.github.com/users/treetopllc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/treetopllc/subscriptions","organizations_url":"https://api.github.com/users/treetopllc/orgs","repos_url":"https://api.github.com/users/treetopllc/repos","events_url":"https://api.github.com/users/treetopllc/events{/privacy}","received_events_url":"https://api.github.com/users/treetopllc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/treetopllc/xml","description":"XML, XSLT, and XML Cryptographic C library Wrapper","fork":true,"url":"https://api.github.com/repos/treetopllc/xml","forks_url":"https://api.github.com/repos/treetopllc/xml/forks","keys_url":"https://api.github.com/repos/treetopllc/xml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/treetopllc/xml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/treetopllc/xml/teams","hooks_url":"https://api.github.com/repos/treetopllc/xml/hooks","issue_events_url":"https://api.github.com/repos/treetopllc/xml/issues/events{/number}","events_url":"https://api.github.com/repos/treetopllc/xml/events","assignees_url":"https://api.github.com/repos/treetopllc/xml/assignees{/user}","branches_url":"https://api.github.com/repos/treetopllc/xml/branches{/branch}","tags_url":"https://api.github.com/repos/treetopllc/xml/tags","blobs_url":"https://api.github.com/repos/treetopllc/xml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/treetopllc/xml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/treetopllc/xml/git/refs{/sha}","trees_url":"https://api.github.com/repos/treetopllc/xml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/treetopllc/xml/statuses/{sha}","languages_url":"https://api.github.com/repos/treetopllc/xml/languages","stargazers_url":"https://api.github.com/repos/treetopllc/xml/stargazers","contributors_url":"https://api.github.com/repos/treetopllc/xml/contributors","subscribers_url":"https://api.github.com/repos/treetopllc/xml/subscribers","subscription_url":"https://api.github.com/repos/treetopllc/xml/subscription","commits_url":"https://api.github.com/repos/treetopllc/xml/commits{/sha}","git_commits_url":"https://api.github.com/repos/treetopllc/xml/git/commits{/sha}","comments_url":"https://api.github.com/repos/treetopllc/xml/comments{/number}","issue_comment_url":"https://api.github.com/repos/treetopllc/xml/issues/comments{/number}","contents_url":"https://api.github.com/repos/treetopllc/xml/contents/{+path}","compare_url":"https://api.github.com/repos/treetopllc/xml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/treetopllc/xml/merges","archive_url":"https://api.github.com/repos/treetopllc/xml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/treetopllc/xml/downloads","issues_url":"https://api.github.com/repos/treetopllc/xml/issues{/number}","pulls_url":"https://api.github.com/repos/treetopllc/xml/pulls{/number}","milestones_url":"https://api.github.com/repos/treetopllc/xml/milestones{/number}","notifications_url":"https://api.github.com/repos/treetopllc/xml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/treetopllc/xml/labels{/name}","releases_url":"https://api.github.com/repos/treetopllc/xml/releases{/id}","deployments_url":"https://api.github.com/repos/treetopllc/xml/deployments","created_at":"2014-07-26T00:36:12Z","updated_at":"2016-03-17T23:49:57Z","pushed_at":"2016-08-22T17:33:27Z","git_url":"git://github.com/treetopllc/xml.git","ssh_url":"git@github.com:treetopllc/xml.git","clone_url":"https://github.com/treetopllc/xml.git","svn_url":"https://github.com/treetopllc/xml","homepage":"","size":152,"stargazers_count":3,"watchers_count":3,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":3,"default_branch":"master"}},"base":{"label":"treetopllc:master","ref":"master","sha":"4f89325e8529de1cbf4446f9e953f4fd5744990e","user":{"login":"treetopllc","id":764597,"avatar_url":"https://avatars.githubusercontent.com/u/764597?v=3","gravatar_id":"","url":"https://api.github.com/users/treetopllc","html_url":"https://github.com/treetopllc","followers_url":"https://api.github.com/users/treetopllc/followers","following_url":"https://api.github.com/users/treetopllc/following{/other_user}","gists_url":"https://api.github.com/users/treetopllc/gists{/gist_id}","starred_url":"https://api.github.com/users/treetopllc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/treetopllc/subscriptions","organizations_url":"https://api.github.com/users/treetopllc/orgs","repos_url":"https://api.github.com/users/treetopllc/repos","events_url":"https://api.github.com/users/treetopllc/events{/privacy}","received_events_url":"https://api.github.com/users/treetopllc/received_events","type":"Organization","site_admin":false},"repo":{"id":22274968,"name":"xml","full_name":"treetopllc/xml","owner":{"login":"treetopllc","id":764597,"avatar_url":"https://avatars.githubusercontent.com/u/764597?v=3","gravatar_id":"","url":"https://api.github.com/users/treetopllc","html_url":"https://github.com/treetopllc","followers_url":"https://api.github.com/users/treetopllc/followers","following_url":"https://api.github.com/users/treetopllc/following{/other_user}","gists_url":"https://api.github.com/users/treetopllc/gists{/gist_id}","starred_url":"https://api.github.com/users/treetopllc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/treetopllc/subscriptions","organizations_url":"https://api.github.com/users/treetopllc/orgs","repos_url":"https://api.github.com/users/treetopllc/repos","events_url":"https://api.github.com/users/treetopllc/events{/privacy}","received_events_url":"https://api.github.com/users/treetopllc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/treetopllc/xml","description":"XML, XSLT, and XML Cryptographic C library Wrapper","fork":true,"url":"https://api.github.com/repos/treetopllc/xml","forks_url":"https://api.github.com/repos/treetopllc/xml/forks","keys_url":"https://api.github.com/repos/treetopllc/xml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/treetopllc/xml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/treetopllc/xml/teams","hooks_url":"https://api.github.com/repos/treetopllc/xml/hooks","issue_events_url":"https://api.github.com/repos/treetopllc/xml/issues/events{/number}","events_url":"https://api.github.com/repos/treetopllc/xml/events","assignees_url":"https://api.github.com/repos/treetopllc/xml/assignees{/user}","branches_url":"https://api.github.com/repos/treetopllc/xml/branches{/branch}","tags_url":"https://api.github.com/repos/treetopllc/xml/tags","blobs_url":"https://api.github.com/repos/treetopllc/xml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/treetopllc/xml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/treetopllc/xml/git/refs{/sha}","trees_url":"https://api.github.com/repos/treetopllc/xml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/treetopllc/xml/statuses/{sha}","languages_url":"https://api.github.com/repos/treetopllc/xml/languages","stargazers_url":"https://api.github.com/repos/treetopllc/xml/stargazers","contributors_url":"https://api.github.com/repos/treetopllc/xml/contributors","subscribers_url":"https://api.github.com/repos/treetopllc/xml/subscribers","subscription_url":"https://api.github.com/repos/treetopllc/xml/subscription","commits_url":"https://api.github.com/repos/treetopllc/xml/commits{/sha}","git_commits_url":"https://api.github.com/repos/treetopllc/xml/git/commits{/sha}","comments_url":"https://api.github.com/repos/treetopllc/xml/comments{/number}","issue_comment_url":"https://api.github.com/repos/treetopllc/xml/issues/comments{/number}","contents_url":"https://api.github.com/repos/treetopllc/xml/contents/{+path}","compare_url":"https://api.github.com/repos/treetopllc/xml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/treetopllc/xml/merges","archive_url":"https://api.github.com/repos/treetopllc/xml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/treetopllc/xml/downloads","issues_url":"https://api.github.com/repos/treetopllc/xml/issues{/number}","pulls_url":"https://api.github.com/repos/treetopllc/xml/pulls{/number}","milestones_url":"https://api.github.com/repos/treetopllc/xml/milestones{/number}","notifications_url":"https://api.github.com/repos/treetopllc/xml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/treetopllc/xml/labels{/name}","releases_url":"https://api.github.com/repos/treetopllc/xml/releases{/id}","deployments_url":"https://api.github.com/repos/treetopllc/xml/deployments","created_at":"2014-07-26T00:36:12Z","updated_at":"2016-03-17T23:49:57Z","pushed_at":"2016-08-22T17:33:27Z","git_url":"git://github.com/treetopllc/xml.git","ssh_url":"git@github.com:treetopllc/xml.git","clone_url":"https://github.com/treetopllc/xml.git","svn_url":"https://github.com/treetopllc/xml","homepage":"","size":152,"stargazers_count":3,"watchers_count":3,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/treetopllc/xml/pulls/7"},"html":{"href":"https://github.com/treetopllc/xml/pull/7"},"issue":{"href":"https://api.github.com/repos/treetopllc/xml/issues/7"},"comments":{"href":"https://api.github.com/repos/treetopllc/xml/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/treetopllc/xml/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/treetopllc/xml/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/treetopllc/xml/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/treetopllc/xml/statuses/f825e50bda7e6b2ef8dad2b976a46a825e09b44c"}}}}
{"actor":{"display_login":"juniorrobot"}}