What is privatekey in oracle objectstorage?

huangapple go评论83阅读模式
英文:

What is privatekey in oracle objectstorage?

问题

以下是翻译好的内容:

c, clerr := objectstorage.NewObjectStorageClientWithConfigurationProvider(common.NewRawConfigurationProvider(
    "ocid1.tenancy.oc1..aaaaaaa5jo3pz1alm1o45rzx1ucaab4njxbwaqqbc7ld3l6biayjaert5la",
    "ocid1.user.oc1..aaaaaaaauax5bo2gg3az46h53467u57ue86rk9h2wax8w7zzamxgwvsi34ja",
    "ap-seoul-1",
    "98:bc:6b:13:c1:64:ds:8b:9c:15:11:d2:8d:e5:92:db",
))

我正在尝试使用Oracle对象存储,我查看了官方手册,但有些地方我不太明白。如上所示,我需要privateKey和privateKeyPassphrase参数,但我不知道从哪里获取它们。是否有详细的解释或示例?

我想要的是将文件上传到存储中。请告诉我在Oracle控制台中的哪个页面可以获取我需要的密钥?请给我一些建议。

英文:
c, clerr := objectstorage.NewObjectStorageClientWithConfigurationProvider(common.NewRawConfigurationProvider(
	"ocid1.tenancy.oc1..aaaaaaa5jo3pz1alm1o45rzx1ucaab4njxbwaqqbc7ld3l6biayjaert5la",
	"ocid1.user.oc1..aaaaaaaauax5bo2gg3az46h53467u57ue86rk9h2wax8w7zzamxgwvsi34ja",
	"ap-seoul-1",
	"98:bc:6b:13:c1:64:ds:8b:9c:15:11:d2:8d:e5:92:db",
	
))

What is privatekey in oracle objectstorage?

I'm trying to use oracle object storage, I checked the official manual, but there is something I don't understand. As above, I need the privateKey, and pricateKeyPassphrase arguments, but I don't know where to get them. Is there a detailed explanation or example?

What i want, is to upload a file to storage.
Where can I go to the page in the oracle console to get the keys I need? please give me some advice

答案1

得分: 2

config, err := common.ConfigurationProviderFromFile("./config", "")
if err != nil {
t.Error(err.Error())
}
c, err := objectstorage.NewObjectStorageClientWithConfigurationProvider(config)
if err != nil {
t.Error(err.Error())
}

我在这个页面上生成了一个密钥,将其放入我的项目中,然后使用上述代码,我能够顺利开始工作,没有遇到任何问题。

英文:
config, err := common.ConfigurationProviderFromFile("./config", "")
	if err != nil {
		t.Error(err.Error())
	}
	c, err := objectstorage.NewObjectStorageClientWithConfigurationProvider(config)
	if err != nil {
		t.Error(err.Error())
	}

https://cloud.oracle.com/identity/domains/my-profile/api-keys

I generated a key on this page, put it in my project, and with the above code I was able to get started without any problems.

huangapple
  • 本文由 发表于 2023年2月13日 14:03:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/75432341.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定