{"action":"created","issue":{"url":"https://api.github.com/repos/dotse/p5-Crypt-PKCS11/issues/17","repository_url":"https://api.github.com/repos/dotse/p5-Crypt-PKCS11","labels_url":"https://api.github.com/repos/dotse/p5-Crypt-PKCS11/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/dotse/p5-Crypt-PKCS11/issues/17/comments","events_url":"https://api.github.com/repos/dotse/p5-Crypt-PKCS11/issues/17/events","html_url":"https://github.com/dotse/p5-Crypt-PKCS11/issues/17","id":161205693,"number":17,"title":"GetAttributeValue CKR_OK + undef","user":{"login":"darinkes","id":637743,"avatar_url":"https://avatars.githubusercontent.com/u/637743?v=3","gravatar_id":"","url":"https://api.github.com/users/darinkes","html_url":"https://github.com/darinkes","followers_url":"https://api.github.com/users/darinkes/followers","following_url":"https://api.github.com/users/darinkes/following{/other_user}","gists_url":"https://api.github.com/users/darinkes/gists{/gist_id}","starred_url":"https://api.github.com/users/darinkes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darinkes/subscriptions","organizations_url":"https://api.github.com/users/darinkes/orgs","repos_url":"https://api.github.com/users/darinkes/repos","events_url":"https://api.github.com/users/darinkes/events{/privacy}","received_events_url":"https://api.github.com/users/darinkes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2016-06-20T14:17:48Z","updated_at":"2016-06-21T07:29:43Z","closed_at":null,"body":"Hi,\r\n\r\nJust want to make sure I'm using GetAttributeValue correctly:\r\n\r\n```perl\r\n# Search a PublicKey\r\nmy $search_template = Crypt::PKCS11::Attributes->new->push(\r\n    Crypt::PKCS11::Attribute::Class->new->set(CKO_PUBLIC_KEY),\r\n);\r\n$session->FindObjectsInit($search_template);\r\nmy $objects = $session->FindObjects(1);\r\n$session->FindObjectsFinal();\r\nprint Dumper $objects;\r\n\r\n# Get Infos of the PublicKey\r\nmy $object_template = Crypt::PKCS11::Attributes->new->push(\r\n   Crypt::PKCS11::Attribute::Id->new(),\r\n   Crypt::PKCS11::Attribute::PublicExponent->new(),\r\n   Crypt::PKCS11::Attribute::Modulus->new(),\r\n);\r\n\r\nmy $object = shift @$objects;\r\nprint $object->id . \"\\n\";\r\nprint Dumper $object_template->toArray;\r\nmy $values = $session->GetAttributeValue($object, $object_template)\r\n    or die \"ERROR: \" . $pkcs11->errstr;\r\nprint Dumper $values;\r\n```\r\n\r\nGives me:\r\n\r\n```\r\n$VAR1 = [\r\n          bless( {\r\n                   'id' => 2123026048\r\n                 }, 'Crypt::PKCS11::Object' )\r\n        ];\r\n2123026048\r\n$VAR1 = [\r\n          {\r\n            'type' => 258,\r\n            'pValue' => undef\r\n          },\r\n          {\r\n            'pValue' => undef,\r\n            'type' => 290\r\n          },\r\n          {\r\n            'pValue' => undef,\r\n            'type' => 288\r\n          }\r\n        ];\r\nERROR: CKR_OK at pkcs112.pl line 47.\r\n```\r\n\r\nGetAttributeValue() always returns undef, but errstr is CKR_OK.\r\n\r\nThanks in advance\r\n"},"comment":{"url":"https://api.github.com/repos/dotse/p5-Crypt-PKCS11/issues/comments/227362010","html_url":"https://github.com/dotse/p5-Crypt-PKCS11/issues/17#issuecomment-227362010","issue_url":"https://api.github.com/repos/dotse/p5-Crypt-PKCS11/issues/17","id":227362010,"user":{"login":"darinkes","id":637743,"avatar_url":"https://avatars.githubusercontent.com/u/637743?v=3","gravatar_id":"","url":"https://api.github.com/users/darinkes","html_url":"https://github.com/darinkes","followers_url":"https://api.github.com/users/darinkes/followers","following_url":"https://api.github.com/users/darinkes/following{/other_user}","gists_url":"https://api.github.com/users/darinkes/gists{/gist_id}","starred_url":"https://api.github.com/users/darinkes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darinkes/subscriptions","organizations_url":"https://api.github.com/users/darinkes/orgs","repos_url":"https://api.github.com/users/darinkes/repos","events_url":"https://api.github.com/users/darinkes/events{/privacy}","received_events_url":"https://api.github.com/users/darinkes/received_events","type":"User","site_admin":false},"created_at":"2016-06-21T07:29:42Z","updated_at":"2016-06-21T07:29:42Z","body":"```perl\r\nmy $object_template = Crypt::PKCS11::Attributes->new->push(\r\n   Crypt::PKCS11::Attribute::Id->new()->set(0,0,0,0,0,0,0,0,0,0)\r\n);\r\n```\r\n\r\ngives a CKR_BUFFER_TOO_SMALL"}}
{"actor":{"display_login":"darinkes"}}