keystore keystore = keystore.getinstance("pkcs12"); keystore.load(r.openrawresource(r.raw.key), "password".tochararray()); privatekey key = (privatekey) keystore.getkey("privatekey", "password".tochararray()); googlecredential credential = new googlecredential.builder().settransport(httptransport) .setjsonfactory(json_factory) .setserviceaccountid(service_account_email) .setserviceaccountscopes(collections.singleton(storage_scope)) .setserviceaccountprivatekey(key) //.setserviceaccountprivatekeyfromp12file(new file("/storage/sdcard0/key.p12")) .build();
w/system.err﹕ pkcs12 key store mac invalid - wrong password or corrupted file.
do have private key downloaded developer console credentials page?
this how connecting google cloud bucket: android googlecredential debug vs release
Comments
Post a Comment