如何注册网址在.net中的谷歌云存储 [英] How to sign url in .net for google cloud storage

查看:151
本文介绍了如何注册网址在.net中的谷歌云存储的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何使用谷歌云存储类在.NET中生成signurl

我已经创建的字符串按要求

  GET


1388534400
/桶/对象名
 

但我现在要签署这个网址与P12键,然后希望把它的URL友好

该库不显示特定功能,它 - > <一个href="https://developers.google.com/resources/api-libraries/documentation/storage/v1/csharp/latest/annotated.html" rel="nofollow">https://developers.google.com/resources/api-libraries/documentation/storage/v1/csharp/latest/annotated.html

所以,基本上我需要Google_Signer_P12类的PHP的.NET交替

  $签名=新Google_Signer_P12(的file_get_contents(__ __ DIR'/'final.p12),notasecret。);
$签名= $ signer-&GT;符号($ to_sign);
 

解决方案

.NET客户端不支持签名的URL(它是一个纯XML API),所以你要么需要进行标注,以类似的工具 gsutil 或生成RSA签名的内部应用程序(<一href="http://stackoverflow.com/questions/8437288/signing-and-verifying-signatures-with-rsa-c-sharp">Signing并验证与RSA C#签名)

I want to know that how to generate signurl using google cloud storage classes in .net

I have created string as per the requirement

GET


1388534400
/bucket/objectname

but I now want to sign this url with p12 key and then want to make it url friendly

This library doesn't show specific function for it -> https://developers.google.com/resources/api-libraries/documentation/storage/v1/csharp/latest/annotated.html

So, basically I need .net alternate of Google_Signer_P12 class of php

$signer = new Google_Signer_P12(file_get_contents(__DIR__.'/'."final.p12"), "notasecret");
$signature = $signer->sign($to_sign);

解决方案

The .NET client doesn't support signing URLs (it is an XML-only API), so you will need to either make a callout to a tool like gsutil or generate an RSA signature internal to your application (Signing and verifying signatures with RSA C#)

这篇关于如何注册网址在.net中的谷歌云存储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆