You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by Andrea Turli <no...@github.com> on 2016/04/07 11:10:04 UTC

Re: [jclouds/jclouds-labs-google] Implementation of password setting for windows (#170)

> +       userName = (String)params.get("userName");
> +       email = (String)params.get("email");
> +
> +      // TODO Check whether VM is up
> +      try {
> +         // Generate the public/private key pair for encryption and decryption.
> +         // TODO do we need to explicitly set 2048 bits? Presumably "RSA" is implicit
> +         KeyPair keys = crypto.rsaKeyPairGenerator().genKeyPair();
> +
> +         // Update instance's metadata with new "windows-keys" entry, and wait for operation to 
> +         // complete.
> +         logger.debug("Generating windows key for instance %s, by updating metadata", instance.get().name());
> +         final InstanceApi instanceApi = api.instancesInZone(zone);
> +         Metadata metadata = instance.get().metadata();
> +         // If disableHtmlEscaping is not there, == will be escaped from modulus value
> +          metadata.put("windows-keys", new GsonBuilder().disableHtmlEscaping().create().toJson(extractKeyMetadata(keys)));

[minor] weird indentation

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/170/files/172e50d1a163c5ba80ed638cf9c7b25982ca204c#r58841075