<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; font-size: 14px; font-family: Calibri, sans-serif; color: rgb(0, 0, 255);">
<div>Hello Asha,</div>
<div><br>
</div>
<div>The AES type key should require an application/octet-stream Accept header to retrieve the secret as it is a binary type. Please replace ‘text/plain’ with ‘application/octet-stream’ in your curl calls below.</div>
<div><br>
</div>
<div>Thanks,</div>
<div>John</div>
<div><br>
</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>Asha Seshagiri <<a href="mailto:asha.seshagiri@gmail.com">asha.seshagiri@gmail.com</a>><br>
<span style="font-weight:bold">Date: </span>Friday, June 5, 2015 at 2:42 PM<br>
<span style="font-weight:bold">To: </span>openstack-dev <<a href="mailto:openstack-dev@lists.openstack.org">openstack-dev@lists.openstack.org</a>><br>
<span style="font-weight:bold">Cc: </span>Douglas Mendizabal <<a href="mailto:douglas.mendizabal@RACKSPACE.COM">douglas.mendizabal@RACKSPACE.COM</a>>, John Wood <<a href="mailto:john.wood@rackspace.com">john.wood@rackspace.com</a>>, "Reller, Nathan S." <<a href="mailto:Nathan.Reller@jhuapl.edu">Nathan.Reller@jhuapl.edu</a>>,
 Adam Harwell <<a href="mailto:adam.harwell@RACKSPACE.COM">adam.harwell@RACKSPACE.COM</a>>, Paul Kehrer <<a href="mailto:paul.kehrer@RACKSPACE.COM">paul.kehrer@RACKSPACE.COM</a>><br>
<span style="font-weight:bold">Subject: </span>Re: Barbican : Retrieval of the secret in text/plain format generated from Barbican order resource<br>
</div>
<div><br>
</div>
<div>
<div>
<div dir="ltr">Hi All ,
<div><br>
</div>
<div>I am currently working on use cases for database and file Encryption.It is really important for us to know since my Encryption use case would be using the key generated by Barbican through order resource as the key.</div>
<div>The encyption algorithms would not accept the binary format and even if converted into ascii , encoding is failing for few of the keys because some characters exceeeds the range of ASCII and for some key  after encoding length exceeds 32 bytes  which is
 the maximum length for doing AES encryption.</div>
<div>It would be great if  someone could respond to the query ,since it would block my further investigations on Encryption usecases using Babrican </div>
<div><br>
</div>
<div>Thanks and Regards,</div>
<div>Asha Seshagiri</div>
<div><br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Wed, Jun 3, 2015 at 3:51 PM, Asha Seshagiri <span dir="ltr">
<<a href="mailto:asha.seshagiri@gmail.com" target="_blank">asha.seshagiri@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div>
<div>
<div>
<div>Hi All,<br>
<br>
</div>
Unable to retrieve the secret in text/plain format  generated from Barbican order resource
<br>
</div>
<br>
</div>
Please find the curl command and responses for <br>
<br>
</div>
<b>Order creation with payload content type as text/plain</b> :<br>
<div>
<div>
<div>
<div>
<div><br>
[root@barbican-automation ~]# curl -X POST -H 'content-type:application/json' -H "X-Auth-Token:9b211b06669249bb89665df068828ee8" \<br>
> -d '{"type" : "key", "meta": {"name": "secretname2","algorithm": "aes", "bit_length":256,  "mode": "cbc", "payload_content_type": <b>"text/plain"</b>}}'  -k
<a href="https://169.53.235.102:9311/v1/orders" target="_blank">https://169.53.235.102:9311/v1/orders</a><br>
<br>
<b>{"order_ref": "<a href="https://169.53.235.102:9311/v1/orders/727113f9-fcda-4366-9f85-93b15edd4680" target="_blank">https://169.53.235.102:9311/v1/orders/727113f9-fcda-4366-9f85-93b15edd4680</a></b>"}<br>
<br>
</div>
<div><b>Retrieval of the order by ORDER ID in order to get to know the secret generated by Barbican</b><br>
</div>
<div><br>
[root@barbican-automation ~]# curl -H 'Accept: application/json' -H "X-Auth-Token:9b211b06669249bb89665df068828ee8" \<br>
> -k  <b><a href="https://169.53.235.102:9311/v1/orders/727113f9-fcda-4366-9f85-93b15edd4680" target="_blank">https://169.53.235.102:9311/v1/orders/727113f9-fcda-4366-9f85-93b15edd4680</a></b><br>
{"status": "ACTIVE", "sub_status": "Unknown", "updated": "2015-06-03T19:08:13", "created": "2015-06-03T19:08:12", "order_ref": "<a href="https://169.53.235.102:9311/v1/orders/727113f9-fcda-4366-9f85-93b15edd4680" target="_blank">https://169.53.235.102:9311/v1/orders/727113f9-fcda-4366-9f85-93b15edd4680</a>",
 "secret_ref": "<b><a href="https://169.53.235.102:9311/v1/secrets/5c25525d-a162-4b0b-9954-90c4ce426c4e" target="_blank">https://169.53.235.102:9311/v1/secrets/5c25525d-a162-4b0b-9954-90c4ce426c4e</a></b>", "creator_id": "cedd848a8a9e410196793c601c03b99a",
 "meta": {"name": "secretname2", "algorithm": "aes", "payload_content_type": "text/plain", "mode": "cbc", "bit_length": 256, "expiration": null}, "sub_status_message": "Unknown", "type": "key"}[root@barbican-automation ~]#<br>
<br>
<br>
<b>Retrieval of the secret failing with the content type text/plain</b><br>
<br>
[root@barbican-automation ~]# curl -H 'Accept:text/plain' -H "X-Auth-Token:9b211b06669249bb89665df068828ee8" -k
<b><a href="https://169.53.235.102:9311/v1/secrets/5c25525d-a162-4b0b-9954-90c4ce426c4e/payload" target="_blank">https://169.53.235.102:9311/v1/secrets/5c25525d-a162-4b0b-9954-90c4ce426c4e/payload</a></b><br>
<span style="color:rgb(255,0,0)"><b>{"code": 500, "description": "Secret payload retrieval failure seen - please contact site administrator.", "title": "Internal Server Error"}</b></span><br>
<br clear="all">
I would like to know wheather this is a bug from Barbican side  since Barbican allows creation of the order resource with text/plain as the payload_content type but the retrieval of the secret payload with the content type text/plain is not allowed.<br>
<br>
</div>
<div>Any help would highly be appreciated.<span class="HOEnZb"><font color="#888888"><br>
</font></span></div>
<span class="HOEnZb"><font color="#888888">
<div>-- <br>
<div>
<div><i>Thanks and Regards,</i></div>
<div><i>Asha Seshagiri</i></div>
</div>
</div>
</font></span></div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div class="gmail_signature">
<div><em>Thanks and Regards,</em></div>
<div><em>Asha Seshagiri</em></div>
</div>
</div>
</div>
</div>
</span>
</body>
</html>