{"action":"created","issue":{"url":"https://api.github.com/repos/kjur/jsrsasign/issues/172","repository_url":"https://api.github.com/repos/kjur/jsrsasign","labels_url":"https://api.github.com/repos/kjur/jsrsasign/issues/172/labels{/name}","comments_url":"https://api.github.com/repos/kjur/jsrsasign/issues/172/comments","events_url":"https://api.github.com/repos/kjur/jsrsasign/issues/172/events","html_url":"https://github.com/kjur/jsrsasign/issues/172","id":149363884,"number":172,"title":"unsupported public key alg: ecdsa","user":{"login":"apowers313","id":5661534,"avatar_url":"https://avatars.githubusercontent.com/u/5661534?v=3","gravatar_id":"","url":"https://api.github.com/users/apowers313","html_url":"https://github.com/apowers313","followers_url":"https://api.github.com/users/apowers313/followers","following_url":"https://api.github.com/users/apowers313/following{/other_user}","gists_url":"https://api.github.com/users/apowers313/gists{/gist_id}","starred_url":"https://api.github.com/users/apowers313/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apowers313/subscriptions","organizations_url":"https://api.github.com/users/apowers313/orgs","repos_url":"https://api.github.com/users/apowers313/repos","events_url":"https://api.github.com/users/apowers313/events{/privacy}","received_events_url":"https://api.github.com/users/apowers313/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-04-19T06:41:39Z","updated_at":"2016-04-19T21:12:18Z","closed_at":null,"body":"Related to #167, sorry for the slow reply...\r\n\r\nI gave up on the signature verification, but now I'm trying to generate a signature and getting a similar error:\r\n> Signature: unsupported public key alg: ecdsa\r\n\r\nHere's the code:\r\n\r\n``` js\r\nvar rs = require(\"jsrsasign\");\r\n\r\nvar pkPem =\r\n\"-----BEGIN EC PARAMETERS-----\" +\r\n\"MIH3AgEBMCwGByqGSM49AQECIQD/////AAAAAQAAAAAAAAAAAAAAAP//////////\" +\r\n\"/////zBbBCD/////AAAAAQAAAAAAAAAAAAAAAP///////////////AQgWsY12Ko6\" +\r\n\"k+ez671VdpiGvGUdBrDMU7D2O848PifSYEsDFQDEnTYIhucEk2pmeOETnSa3gZ9+\" +\r\n\"kARBBGsX0fLhLEJH+Lzm5WOkQPJ3A32BLeszoPShOUXYmMKWT+NC4v4af5uO5+tK\" +\r\n\"fA+eFivOM1drMV7Oy7ZAaDe/UfUCIQD/////AAAAAP//////////vOb6racXnoTz\" +\r\n\"ucrC/GMlUQIBAQ==\" +\r\n\"-----END EC PARAMETERS-----\" +\r\n\"-----BEGIN EC PRIVATE KEY-----\" +\r\n\"MIIBaAIBAQQgDN0CgbLqhn7OmaiBf6XlgDKqjU3GTQAqFrsb4gsPDDuggfowgfcC\" +\r\n\"AQEwLAYHKoZIzj0BAQIhAP////8AAAABAAAAAAAAAAAAAAAA////////////////\" +\r\n\"MFsEIP////8AAAABAAAAAAAAAAAAAAAA///////////////8BCBaxjXYqjqT57Pr\" +\r\n\"vVV2mIa8ZR0GsMxTsPY7zjw+J9JgSwMVAMSdNgiG5wSTamZ44ROdJreBn36QBEEE\" +\r\n\"axfR8uEsQkf4vOblY6RA8ncDfYEt6zOg9KE5RdiYwpZP40Li/hp/m47n60p8D54W\" +\r\n\"K84zV2sxXs7LtkBoN79R9QIhAP////8AAAAA//////////+85vqtpxeehPO5ysL8\" +\r\n\"YyVRAgEBoUQDQgAEhxun/gvzgcI66elt/1xVM6UEQzcF43p5AhJlFl+V1g28Z8ce\" +\r\n\"qwMBxn1w9U8Tye2AzoZzhRa4N4GNEM+jzwcgkw==\" +\r\n\"-----END EC PRIVATE KEY-----\";\r\n\r\nvar hex1 = \"0100000012\";\r\nvar hex2 = \"5a81483d96b0bc15ad19af7f5a662e14b275729fbc05579b18513e7f550016b1\";\r\n\r\n// initialize\r\nvar sig = new KJUR.crypto.Signature({\"alg\": \"SHA256withECDSA\", \"prov\": \"cryptojs/jsrsa\"});\r\n// initialize for signature generation\r\nsig.initSign(pkPem); \r\n// update data\r\nsig.updateHex(hex1);\r\nsig.updateHex(hex2);\r\n// calculate signature\r\nvar sigValueHex = sig.sign();\r\nconsole.log (\"sig:\", sigValueHex);\r\n```"},"comment":{"url":"https://api.github.com/repos/kjur/jsrsasign/issues/comments/212132085","html_url":"https://github.com/kjur/jsrsasign/issues/172#issuecomment-212132085","issue_url":"https://api.github.com/repos/kjur/jsrsasign/issues/172","id":212132085,"user":{"login":"kjur","id":1206524,"avatar_url":"https://avatars.githubusercontent.com/u/1206524?v=3","gravatar_id":"","url":"https://api.github.com/users/kjur","html_url":"https://github.com/kjur","followers_url":"https://api.github.com/users/kjur/followers","following_url":"https://api.github.com/users/kjur/following{/other_user}","gists_url":"https://api.github.com/users/kjur/gists{/gist_id}","starred_url":"https://api.github.com/users/kjur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kjur/subscriptions","organizations_url":"https://api.github.com/users/kjur/orgs","repos_url":"https://api.github.com/users/kjur/repos","events_url":"https://api.github.com/users/kjur/events{/privacy}","received_events_url":"https://api.github.com/users/kjur/received_events","type":"User","site_admin":false},"created_at":"2016-04-19T21:12:18Z","updated_at":"2016-04-19T21:12:18Z","body":"How about following to use sig.init?:\r\n\r\n```JavaScript\r\nvar sig = new rs.KJUR.crypto.Signature({\"alg\": \"SHA256withECDSA\"});\r\nsig.init(pkP8); \r\nsig.updateHex(hex1);\r\nsig.updateHex(hex2);\r\nvar sigValueHex = sig.sign();\r\n```\r\n\r\nThis works fine for me.\r\n"}}