Search code examples
gooracle-cloud-infrastructurecloud-object-storage

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",
    
))

enter image description here

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


Solution

  • 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.