diff --git a/lib/services/keyVault/README.md b/lib/services/keyVault/README.md index 1264ffd99..f3c89afaf 100644 --- a/lib/services/keyVault/README.md +++ b/lib/services/keyVault/README.md @@ -1,7 +1,7 @@ # Microsoft Azure SDK for Node.js - Key Vault This project provides a Node.js package for accessing keys and secrets on Azure Key Vault. Right now it supports: -- **Node.js version: 0.8.28 or higher** +- **Node.js version: 4.x.x or higher** - **REST API version: 2015-06-01** ## Features @@ -9,6 +9,7 @@ This project provides a Node.js package for accessing keys and secrets on Azure - Manage keys: create, import, update, delete, backup, restore, list and get. - Key operations: sign, verify, encrypt, decrypt, wrap, unwrap. - Secret operations: set, get, update and list. +- Certificate operations: set, get, update and list. ## How to Install @@ -21,105 +22,186 @@ npm install azure-keyvault The following example writes and reads a secret, creates a key and uses it for encrypt and decrypt some data. ```javascript -var async = require('async'); -var adalNode = require('adal-node'); // Used for authentication -var azureKeyVault = require('azure-keyvault'); +var KeyVault = require('azure-keyvault'); +var util = require('util'); +var Crypto = require('crypto'); +var AuthenticationContext = require('adal-node').AuthenticationContext; -var clientId = ''; -var clientSecret = ''; +var clientId = ""; +var clientSecret = ""; +var vaultUri = ""; -var credentials = new azureKeyVault.KeyVaultCredentials(authenticator); -var client = new azureKeyVault.KeyVaultClient(credentials); +// Authenticator - retrieves the access token +var authenticator = function (challenge, callback) { -var vaultUri = 'https://.vault.azure.net'; -var secret = 'Chocolate is hidden in the toothpaste cabinet'; -var secretId; -var kid; -var plainText = '1234567890'; -var cipherText; - -async.series([ - - function (next) { - // Writes a secret - var request = { value: secret }; - console.info('Writing secret...'); - client.setSecret(vaultUri, 'mySecret', request, function(err, result) { - if (err) throw err; - console.info('Secret written: ' + JSON.stringify(result, null, ' ')); - secretId = result.id; - next(); - }); - }, - - function (next) { - // Reads a secret - console.info('Reading secret...'); - client.getSecret(secretId, function(err, result) { - if (err) throw err; - console.info('Secret read: ' + JSON.stringify(result, null, ' ')); - next(); - }); - }, - - function (next) { - // Creates a key - var request = { kty: "RSA", key_ops: ["encrypt", "decrypt"] }; - console.info('Creating key...'); - client.createKey(vaultUri, 'mykey', request, function(err, result) { - if (err) throw err; - console.info('Key created: ' + JSON.stringify(result)); - kid = result.key.kid; - next(); - }); - }, - - function (next) { - // Encrypts some data with the key. - console.info('Encrypting text...'); - client.encrypt(kid, 'RSA-OAEP', new Buffer(plainText), function(err, result) { - if (err) throw err; - console.info('Encryption result: ' + JSON.stringify(result)); - cipherText = result.value; - next(); - }); - }, - - function (next) { - // Decrypts data with the key. - console.info('Decrypting text...'); - client.decrypt(kid, 'RSA-OAEP', cipherText, function(err, result) { - if (err) throw err; - console.info('Decryption result: ' + JSON.stringify(result)); - var decrypted = result.value.toString(); - if (decrypted !== plainText) { - throw new Error('Was expecting "' + plainText + '", not "' + decrypted + '".'); - } - next(); - }); - }, - - function (next) { - console.info('Finished with success!'); - next(); - } - -]); - -function authenticator(challenge, callback) { // Create a new authentication context. - var context = new adalNode.AuthenticationContext(challenge.authorization); + var context = new AuthenticationContext(challenge.authorization); + // Use the context to acquire an authentication token. - return context.acquireTokenWithClientCredentials(challenge.resource, clientId, clientSecret, function(err, tokenResponse) { - if (err) throw err; - // Calculate the value to be set in the request's Authorization header and resume the call. - var authorizationValue = tokenResponse.tokenType + ' ' + tokenResponse.accessToken; - return callback(null, authorizationValue); + return context.acquireTokenWithClientCredentials(challenge.resource, clientId, clientSecret, function (err, tokenResponse) { + if (err) throw err; + // Calculate the value to be set in the request's Authorization header and resume the call. + var authorizationValue = tokenResponse.tokenType + ' ' + tokenResponse.accessToken; + + return callback(null, authorizationValue); }); -} + +}; + +var credentials = new KeyVault.KeyVaultCredentials(authenticator); +var client = new KeyVault.KeyVaultClient(credentials); + +var attributes = { expires: new Date('2050-02-02T08:00:00.000Z'), notBefore: new Date('2016-01-01T08:00:00.000Z') }; +var keyOperations = ['encrypt', 'decrypt', 'sign', 'verify', 'wrapKey', 'unwrapKey']; + +//Create a key +client.createKey(vaultUri, 'mykey', 'RSA', { keyOps: keyOperations, keyAttributes: attributes }, function(err, keyBundle) { + if (err) throw err; + console.log('\n\nkey ', keyBundle.key.kid, ' is created.\n', util.inspect(keyBundle, { depth: null })); + + // Retrieve the key + client.getKey(keyBundle.key.kid, function(getErr, getKeyBundle) { + if (getErr) throw getErr; + console.log('\n\nkey ', getKeyBundle.key.kid, ' is retrieved.\n'); + + // Encrypt a plain text + var encryptionContent = new Buffer('This message is to be encrypted...'); + client.encrypt(keyBundle.key.kid, 'RSA-OAEP', encryptionContent, function (encryptErr, cipherText) { + if (encryptErr) throw encryptErr; + console.log('\n\nText is encrypted: ', cipherText.result); + + // Decrypt a cipher text + client.decrypt(keyBundle.key.kid, 'RSA-OAEP', cipherText.result, function (decryptErr, plainText) { + if (decryptErr) throw decryptErr; + console.log('\n\nThe encrypted cipher text is decrypted to: ', plainText.result); + }); + }); + + // Sign a digest value + var hash = Crypto.createHash('sha256'); + var digest = hash.update(new Buffer('sign me')).digest(); + client.sign(keyBundle.key.kid, 'RS256', digest, function (signErr, signature) { + if (signErr) throw signErr; + console.log('The signature for digest ', digest, ' is: ', signature.result); + + // Verify a signature + client.verify(keyBundle.key.kid, 'RS256', digest, signature.result, function (verifyErr, verification) { + if (verifyErr) throw verifyErr; + console.log('The verification', verification.value === true? 'succeeded':'failed'); + }); + }); + + }); + + // Update the key with new tags + client.updateKey(keyBundle.key.kid, {tags: {'tag1': 'this is tag1', 'tag2': 'this is tag2'}}, function (getErr, updatedKeyBundle) { + if (getErr) throw getErr; + console.log('\n\nkey ', updatedKeyBundle.key.kid, ' is updated.\n', util.inspect(updatedKeyBundle, { depth: null })); + }); + + // List all versions of the key + var parsedId = KeyVault.parseKeyIdentifier(keyBundle.key.kid); + client.getKeyVersions(parsedId.vault, parsedId.name, function (getVersionsErr, result) { + if (getVersionsErr) throw getVersionsErr; + + var loop = function (nextLink) { + if (nextLink !== null && nextLink !== undefined) { + client.getKeyVersionsNext(nextLink, function (err, res) { + console.log(res); + loop(res.nextLink); + }); + } + }; + + console.log(result); + loop(result.nextLink); + }); +}); + + +//Create a secret +client.setSecret(vaultUri, 'mysecret', 'my password', { contentType: 'test secret', secretAttributes: attributes }, function (err, secretBundle) { + if (err) throw err; + console.log('\n\nSecret ', secretBundle.id, ' is created.\n', util.inspect(secretBundle, { depth: null })); + + // Retrieve the secret + client.getSecret(secretBundle.id, function (getErr, getSecretBundle) { + if (getErr) throw getErr; + console.log('\n\nSecret ', getSecretBundle.id, ' is retrieved.\n'); + }); + + // List all secrets + var parsedId = KeyVault.parseSecretIdentifier(secretBundle.id); + client.getSecrets(parsedId.vault, parsedId.name, function (err, result) { + if (err) throw err; + + var loop = function (nextLink) { + if (nextLink !== null && nextLink !== undefined) { + client.getSecretsNext(nextLink, function (err, res) { + console.log(res); + loop(res.nextLink); + }); + } + }; + + console.log(result); + loop(result.nextLink); + }); +}); + +var certificatePolicy = { + keyProperties : { + exportable: true, + reuseKey : false, + keySize : 2048, + keyType : 'RSA' + }, + secretProperties : { + contentType : 'application/x-pkcs12' + }, + issuerReference : { + name : 'Self' + }, + x509CertificateProperties : { + subject : 'CN=*.microsoft.com', + subjectAlternativeNames : ["onedrive.microsoft.com", "xbox.microsoft.com"], + validityInMonths : 24 + } +}; +var intervalTime = 5000; + +//Create a certificate +client.createCertificate(vaultUri, 'mycertificate', { certificatePolicy: certificatePolicy }, function (err, certificateOperation) { + if (err) throw err; + console.log('\n\nCertificate', certificateOperation.id, 'is being created.\n', util.inspect(certificateOperation, { depth: null })); + + // Poll the certificate status until it is created + var interval = setInterval(function getCertStatus() { + + var parsedId = KeyVault.parseCertificateOperationIdentifier(certificateOperation.id); + client.getCertificateOperation(parsedId.vault, parsedId.name, function (err, pendingCertificate) { + if (err) throw err; + + if (pendingCertificate.status.toUpperCase() === 'completed'.toUpperCase()) { + clearInterval(interval); + console.log('\n\nCertificate', pendingCertificate.target, 'is created.\n', util.inspect(pendingCertificate, { depth: null })); + + var parsedCertId = KeyVault.parseCertificateIdentifier(pendingCertificate.target); + //Delete the created certificate + client.deleteCertificate(parsedCertId.vault, parsedCertId.name, function (delErr, deleteResp) { + console.log('\n\nCertificate', pendingCertificate.target, 'is deleted.\n'); + }); + } + else if (pendingCertificate.status.toUpperCase() === 'InProgress'.toUpperCase()) { + console.log('\n\nCertificate', certificateOperation.id, 'is being created.\n', util.inspect(pendingCertificate, { depth: null })); + } + }); + }, intervalTime); +}); + ``` ## Related projects - [Microsoft Azure SDK for Node.js](https://github.com/azure/azure-sdk-for-node) -- [Microsoft Azure SDK for Node.js - Key Vault Management](https://github.com/Azure/azure-sdk-for-node/tree/master/lib/services/keyVault) +- [Microsoft Azure SDK for Node.js - Key Vault Management](https://github.com/Azure/azure-sdk-for-node/tree/master/lib/services/keyVaultManagement) diff --git a/lib/services/keyVault/lib/jwk.js b/lib/services/keyVault/lib/jwk.js index 66531a517..7ac9c7005 100644 --- a/lib/services/keyVault/lib/jwk.js +++ b/lib/services/keyVault/lib/jwk.js @@ -61,78 +61,9 @@ JsonWebKeyType.OCT = 'oct'; /** @class */ -function JsonWebKey() { - - /** The key identifier. - * @member {string} - */ - this.kid = null; - - /** The key type. Typically is one of {@linkcode JsonWebKeyType} constants. - * @member {string} - */ - this.kty = null; - - /** An array describing the operations supported by this key. - * @member {string[]} - */ - this.key_ops = null; - - /** Symmetric key material. - * @member {Buffer} - */ - this.k = null; - - /** The RSA public modulus. - * @member {Buffer} - */ - this.n = null; - - /** The RSA public exponent. - * @member {Buffer} - */ - this.e = null; - - /** An RSA private key component. - * @member {Buffer} - */ - this.d = null; - - /** An RSA private key component. - * @member {Buffer} - */ - this.p = null; - - /** An RSA private key component. - * @member {Buffer} - */ - this.q = null; - - /** An RSA private key component. - * @member {Buffer} - */ - this.dp = null; - - /** An RSA private key component. - * @member {Buffer} - */ - this.dq = null; - - /** An RSA private key component. - * @member {Buffer} - */ - this.qi = null; - - /** HSM Token, used with "Bring Your Own Key". - * @member {Buffer} - */ - this.key_hsm = null; - -} var exports = module.exports; exports.JsonWebKeyEncryptionAlgorithms = JsonWebKeyEncryptionAlgorithms; exports.JsonWebKeySignatureAlgorithms = JsonWebKeySignatureAlgorithms; -exports.JsonWebKeyType = JsonWebKeyType; -exports.JsonWebKey = JsonWebKey; +exports.JsonWebKeyType = JsonWebKeyType; \ No newline at end of file diff --git a/lib/services/keyVault/lib/keyVault.js b/lib/services/keyVault/lib/keyVault.js index 998b926ca..87ea1be5a 100644 --- a/lib/services/keyVault/lib/keyVault.js +++ b/lib/services/keyVault/lib/keyVault.js @@ -1,997 +1,2205 @@ -// -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// +/* + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +/* jshint latedef:false */ +/* jshint forin:false */ +/* jshint noempty:false */ 'use strict'; -/* jshint latedef:false */ -/* jshint camelcase:false */ -var _ = require('underscore'); -var url = require('url'); var util = require('util'); +var msRest = require('ms-rest'); +var msRestAzure = require('ms-rest-azure'); + +var ServiceClient = msRestAzure.AzureServiceClient; +var WebResource = msRest.WebResource; + +var models = require('./models'); var jwk = require('./jwk'); var kvcreds = require('./keyVaultCredentials'); - -var exports = module.exports; - -exports.JsonWebKey = jwk.JsonWebKey; -exports.JsonWebKeyEncryptionAlgorithms = jwk.JsonWebKeyEncryptionAlgorithms; -exports.JsonWebKeySignatureAlgorithms = jwk.JsonWebKeySignatureAlgorithms; -exports.KeyVaultCredentials = kvcreds.KeyVaultCredentials; - -/** Identifier of the resource on which Key Vault users and service principals must authenticate. - */ -exports.RESOURCE_ID = 'https://vault.azure.net'; +var objId = require('./objectIdentifier'); // The internal client is too low level, so we wrap it instead of exposing it directly. -var InternalClient = require('./keyVaultInternalClient'); +var InternalClient = require('./keyVaultClient'); /** -* Creates a new {@linkcode KeyVaultClient} object. -* -* @param {object} [credentials] The credentials, typically a {@linkcode KeyVaultCredentials} object. If null, an authentication filter must be provided. -* @param {string} [baseUri] Ignored, may be null. -* @param {array} [filters] Extra filters to attach to the client. -* @return {KeyVaultClient} -*/ -exports.createKeyVaultClient = function (credentials, baseUri, filters) { - return new exports.KeyVaultClient(credentials, baseUri, filters); -}; + * @class + * Initializes a new instance of the KeyVaultClient class. + * @constructor + * + * @param {credentials} credentials - Credentials needed for the client to connect to Azure. + * + * @param {object} [options] - The parameter options + * + * @param {Array} [options.filters] - Filters to be added to the request pipeline + * + * @param {object} [options.requestOptions] - Options for the underlying request object + * {@link https://github.com/request/request#requestoptions-callback Options doc} + * + * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy + * + * @param {string} [options.apiVersion] - Client Api Version. + * + * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. + * + * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + */ +function KeyVaultClient(credentials, options) { -/** -* A Key Vault client object. -* -* @class -* @param {object} [credentials] The credentials, typically a {@linkcode KeyVaultCredentials} object. If null, an authentication filter must be provided. -* @param {string} [baseUri] Ignored, may be null. -* @param {array} [filters] Extra filters to attach to the client. -*/ -function KeyVaultClient(credentials, baseUri, filters) { if (credentials.createSigningFilter) { - if (!filters) filters = []; - filters.push(credentials.createSigningFilter()); + if(!options) options = []; + if (!options.filters) options.filters = []; + options.filters.push(credentials.createSigningFilter()); } - this._internalClient = new InternalClient.KeyVaultInternalClient(credentials, baseUri, filters); - this._keys = this._internalClient.keys; - this._secrets = this._internalClient.secrets; -} - -exports.KeyVaultClient = KeyVaultClient; - -/** See {@linkcode Service#withFilter}. -*/ -KeyVaultClient.prototype.withFilter = function (newFilter) { - this._internalClient = this._internalClient.withFilter(newFilter); - this._keys = this._internalClient.keys; - this._secrets = this._internalClient.secrets; - return this; -}; - -/** - * Performs an ENCRYPT operation using the specified key. - * - * @param {string} keyIdentifier The key identifier. It may or may not contain a version path. If a version is not provided, the latest key version is used. - * @param {string} algorithm The algorithm name. Use a constant from {@linkcode JsonWebKeyEncryptionAlgorithms}. - * @param {Buffer} plainText A {@linkcode Buffer} containing the data to be encrypted. - * @param {KeyVaultClient~valueCallback} callback A callback that will be called on completion. The value will contain the ciphertext. - */ -KeyVaultClient.prototype.encrypt = function(keyIdentifier, algorithm, plainText, callback) { - var keyOpRequest = createKeyOpRequest(algorithm, plainText); - var result = this._keys.encryptData(keyIdentifier, serializeKeyRequest(keyOpRequest), valueResponseDeserializer(callback)); - return result; -}; - -/** - * Performs a DECRYPT operation using the specified key. - * - * @param {string} keyIdentifier The key identifier. It may or may not contain a version path. If a version is not provided, the latest key version is used. - * @param {string} algorithm The algorithm name. Use a constant from {@linkcode JsonWebKeyEncryptionAlgorithms}. - * @param {Buffer} cipherText A {@linkcode Buffer} containing the data to be decrypted. - * @param {KeyVaultClient~valueCallback} callback A callback that will be called on completion. The value will contain the plaintext. - */ -KeyVaultClient.prototype.decrypt = function(keyIdentifier, algorithm, cipherText, callback) { - var keyOpRequest = createKeyOpRequest(algorithm, cipherText); - var result = this._keys.decryptData(keyIdentifier, serializeKeyRequest(keyOpRequest), valueResponseDeserializer(callback)); - return result; -}; - -/** - * Performs a SIGN operation using the specified key. - * - * @param {string} keyIdentifier The key identifier. It may or may not contain a version path. If a version is not provided, the latest key version is used. - * @param {string} algorithm The algorithm name. Use a constant from {@linkcode JsonWebKeySignatureAlgorithms}. - * @param {Buffer} digest A {@linkcode Buffer} containing the digest to be signed. It must be a valid digest. - * @param {KeyVaultClient~valueCallback} callback A callback that will be called on completion. The value will contain the signature. - */ -KeyVaultClient.prototype.sign = function(keyIdentifier, algorithm, digest, callback) { - var keyOpRequest = createKeyOpRequest(algorithm, digest); - var result = this._keys.sign(keyIdentifier, serializeKeyRequest(keyOpRequest), valueResponseDeserializer(callback)); - return result; -}; - -/** - * Performs a VERIFY operation using the specified key. - * - * @param {string} keyIdentifier The key identifier. It may or may not contain a version path. If a version is not provided, the latest key version is used. - * @param {string} algorithm The algorithm name. Use a constant from {@linkcode JsonWebKeySignatureAlgorithms}. - * @param {Buffer} digest A {@linkcode Buffer} containing the digest that was signed. - * @param {Buffer} signature A {@linkcode Buffer} containing the signature to be verified. - * @param {KeyVaultClient~boolCallback} callback A callback that will be called on completion. The value will be true if the signature is valid for the digest. - */ -KeyVaultClient.prototype.verify = function(keyIdentifier, algorithm, digest, signature, callback) { - var keyOpRequest = createVerifyOpRequest(algorithm, digest, signature); - var result = this._keys.verify(keyIdentifier, serializeKeyRequest(keyOpRequest), keyResponseDeserializer(callback)); - return result; -}; - -/** - * Performs a WRAP KEY operation using the specified key. - * - * @param {string} keyIdentifier The key identifier. It may or may not contain a version path. If a version is not provided, the latest key version is used. - * @param {string} algorithm The algorithm name. Use a constant from {@linkcode JsonWebKeyEncryptionAlgorithms}. - * @param {Buffer} key A {@linkcode Buffer} containing the key material to be wrapped. - * @param {KeyVaultClient~valueCallback} callback A callback that will be called on completion. The value will contain the wrapped key. - */ -KeyVaultClient.prototype.wrapKey = function(keyIdentifier, algorithm, key, callback) { - var keyOpRequest = createKeyOpRequest(algorithm, key); - var result = this._keys.wrapKey(keyIdentifier, serializeKeyRequest(keyOpRequest), valueResponseDeserializer(callback)); - return result; -}; - -/** - * Performs an UNWRAP KEY operation using the specified key. - * - * @param {string} keyIdentifier The key identifier. It may or may not contain a version path. If a version is not provided, the latest key version is used. - * @param {string} algorithm The algorithm name. Use a constant from {@linkcode JsonWebKeyEncryptionAlgorithms}. - * @param {Buffer} cipherText A {@linkcode Buffer} containing the wrapped key. - * @param {KeyVaultClient~valueCallback} callback A callback that will be called on completion. The value will contain the unwrapped key material. - */ -KeyVaultClient.prototype.unwrapKey = function(keyIdentifier, algorithm, wrappedKey, callback) { - var keyOpRequest = createKeyOpRequest(algorithm, wrappedKey); - var result = this._keys.unwrapKey(keyIdentifier, serializeKeyRequest(keyOpRequest), valueResponseDeserializer(callback)); - return result; -}; - -/** - * Performs a GET KEY operation, which retrieves key attributes from the service. - * - * @param {string} keyIdentifier The key identifier. It may or may not contain a version path. If a version is not provided, the latest key version is used. - * @param {KeyVaultClient~keyBundleCallback} callback A callback that will be called on completion. - */ -KeyVaultClient.prototype.getKey = function(keyIdentifier, callback) { - var result = this._keys.get(keyIdentifier, keyBundleResponseDeserializer(callback)); - return result; -}; - -/** - * Performs a GET KEYS operation, which lists keys of a vault. - * This operation may use paging. Call {@linkcode #getKeysNext} to retrieve more pages. - * - * @param {string} vault The vault identifier. - * @param {number} maxresults The maximum number of keys to return. This is the total number of keys, not the size of first page. - * @param {KeyVaultClient~keyListCallback} callback A callback that will be called on completion. - */ -KeyVaultClient.prototype.getKeys = function(vault, maxresults, callback) { - var result = this._keys.list(vault, maxresults, keyListResponseDeserializer(callback)); - return result; -}; - -/** - * Resumes a GET KEYS operation by returning the next page. - * - * @param {string} nextLink The value returned by a previous call to {@linkcode #getKeys} or {@linkcode #getKeysNext}. - * @param {KeyVaultClient~keyListCallback} callback A callback that will be called on completion. - */ -KeyVaultClient.prototype.getKeysNext = function(nextLink, callback) { - var result = this._keys.listNext(nextLink, keyListResponseDeserializer(callback)); - return result; -}; - -/** - * Performs a GET KEY VERSIONS operation, which lists all versions of a key. - * This operation may use paging. Call {@linkcode #getKeyVersionsNext} to retrieve more pages. - * - * @param {string} vault The vault identifier. - * @param {string} keyName The key name. - * @param {number} maxresults The maximum number of key versions to return. This is the total number of items, not the size of first page. - * @param {KeyVaultClient~keyListCallback} callback A callback that will be called on completion. - */ -KeyVaultClient.prototype.getKeyVersions = function(vault, keyName, maxresults, callback) { - var result = this._keys.listVersions(vault, keyName, maxresults, keyListResponseDeserializer(callback)); - return result; -}; - -/** - * Resumes a GET KEY VERSIONS operation by returning the next page. - * - * @param {string} nextLink The value returned by a previous call to {@linkcode #getKeyVersions} or {@linkcode #getKeyVersionsNext}. - * @param {KeyVaultClient~keyListCallback} callback A callback that will be called on completion. - */ -KeyVaultClient.prototype.getKeyVersionsNext = function(nextLink, callback) { - var result = this._keys.listVersionsNext(nextLink, keyListResponseDeserializer(callback)); - return result; -}; - -/** - * Performs a CREATE KEY operation, which creates a key and stores in the service. - * - * @param {string} vault The vault identifier. - * @param {string} keyName The key name. If a key with this name already exists, the service creates a new version and set as current. - * @param {string} request.kty The key type. Use a constant from {@linkcode JsonWebKeyType}. - * @param {number} [request.key_size] The key size. Must be valid for the key type. If omitted, a default for the key type is used. - * @param {string[]} [request.key_ops] The allowed operations on the key. Each can be a constant from {@linkcode JsonWebKeyOperation}. - * @param {KeyAttributes} [request.attributes] Initial attributes. If omitted, a service defined default is used. - * @param {object} [request.tags] User defined tags to be associated with the key. - * @param {KeyVaultClient~keyBundleCallback} callback A callback that will be called on completion. - */ -KeyVaultClient.prototype.createKey = function(vault, keyName, request, callback) { - var result = this._keys.create(vault, keyName, serializeKeyRequest(request), keyBundleResponseDeserializer(callback)); - return result; -}; - -/** - * Performs a DELETE KEY operation, which deletes a key and all its versions. - * This method returns data about the current version of deleted key. - * - * @param {string} vault The vault identifier. - * @param {string} keyName The key name. - * @param {KeyVaultClient~keyBundleCallback} callback A callback that will be called on completion. - */ -KeyVaultClient.prototype.deleteKey = function(vault, keyName, callback) { - var result = this._keys.deleteKey(vault, keyName, keyBundleResponseDeserializer(callback)); - return result; -}; - -/** - * Performs an UPDATE KEY operation, which updates attributes of a key version. - * - * @param {string} keyIdentifier The key identifier. It may or may not contain a version path. If a version is not provided, the latest key version is used. - * @param {string[]} [request.key_ops] If informed, changes allowed operations. Each can be a constant from {@linkcode JsonWebKeyOperation}. - * @param {KeyAttributes} [request.attributes] If informed, changes attributes. - * @param {object} [request.tags] If informed, replaces all tags. - * @param {KeyVaultClient~keyBundleCallback} callback A callback that will be called on completion. - */ -KeyVaultClient.prototype.updateKey = function(keyIdentifier, request, callback) { - var result = this._keys.update(keyIdentifier, serializeKeyRequest(request), keyBundleResponseDeserializer(callback)); - return result; -}; - -/** - * Performs an IMPORT KEY operation, which imports existing key material into a new key that is stored on the service. - * - * @param {string} vault The vault identifier. - * @param {string} keyName The key name. If a key with this name already exists, the service creates a new version and set as current. - * @param {string} request.key A {@linkcode JsonWebKey} that describes the key to be imported. The kid property is ignored. - * @param {boolean} [request.hsm] true to import as a "hardware" key, false to import as "software" key. Default is false. - * @param {KeyAttributes} [request.attributes] Initial attributes. If omitted, a service defined default is used. - * @param {object} [request.tags] User defined tags to be associated with the key. - * @param {KeyVaultClient~keyBundleCallback} callback A callback that will be called on completion. - */ -KeyVaultClient.prototype.importKey = function(vault, keyName, request, callback) { - var keyIdentifier = createKeyIdentifier(vault, keyName).identifier; - var result = this._keys.importMethod(keyIdentifier, serializeImportKeyRequest(request), keyBundleResponseDeserializer(callback)); - return result; -}; - -/** - * Performs a BACKUP KEY operation, which backs up a key and all its versions. - * - * @param {string} vault The vault identifier. - * @param {string} keyName The key name. - * @param {KeyVaultClient~valueCallback} callback A callback that will be called on completion. The value is a sequence of bytes suitable for the RESTORE KEY operation. - */ -KeyVaultClient.prototype.backupKey = function(vault, keyName, callback) { - var keyIdentifier = createKeyIdentifier(vault, keyName).identifier; - var result = this._keys.backup(keyIdentifier, valueResponseDeserializer(callback)); - return result; -}; - -/** - * Performs a RESTORE KEY operation, which restores a key and all its versions. The key to be restored must not exist previously. - * This method returns data about the restored key. Despite all versions are being restored, only the current version is returned. - * - * @param {string} vault The vault identifier. - * @param {Buffer} backupValue A sequence of bytes obtained through the BACKUP KEY operation. - * @param {KeyVaultClient~keyBundleCallback} callback A callback that will be called on completion. - */ -KeyVaultClient.prototype.restoreKey = function(vault, backupValue, callback) { - var keyOpRequest = createRestoreKeyRequest(backupValue); - var result = this._keys.restore(vault, serializeKeyRequest(keyOpRequest), keyBundleResponseDeserializer(callback)); - return result; -}; - -/** - * Performs a GET SECRET operation, which retrieves secret attributes from the service. - * - * @param {string} secretIdentifier The secret identifier. It may or may not contain a version path. If a version is not provided, the latest secret version is used. - * @param {KeyVaultClient~secretBundleCallback} callback A callback that will be called on completion. - */ -KeyVaultClient.prototype.getSecret = function(secretIdentifier, callback) { - var result = this._secrets.get(secretIdentifier, secretBundleResponseDeserializer(callback)); - return result; -}; - -/** - * Performs a SET SECRET operation, which stores a secret in the service. - * - * @param {string} vault The vault identifier. - * @param {string} secretName The secret name. If a secret with this name already exists, the service creates a new version and set as current. - * @param {string} request.value The secret value. - * @param {string} [request.contentType] The value's content type. - * @param {SecretAttributes} [request.attributes] Initial attributes. If omitted, a service defined default is used. - * @param {object} [request.tags] User defined tags to be associated with the secret. - * @param {KeyVaultClient~secretBundleCallback} callback A callback that will be called on completion. - */ -KeyVaultClient.prototype.setSecret = function(vault, secretName, request, callback) { - var secretIdentifier = createSecretIdentifier(vault, secretName).identifier; - var result = this._secrets.set(secretIdentifier, serializeSecretRequest(request), secretBundleResponseDeserializer(callback)); - return result; -}; - -/** - * Performs an UPDATE SECRET operation, which updates attributes of a secret version. - * - * @param {string} secretIdentifier The secret identifier. It may or may not contain a version path. If a version is not provided, the latest secret version is used. - * @param {stri} [request.contentType] If informed, changes the value's content type. - * @param {SecretAttributes} [request.attributes] If informed, changes attributes. - * @param {object} [request.tags] If informed, replaces all tags. - * @param {KeyVaultClient~secretBundleCallback} callback A callback that will be called on completion. - */ -KeyVaultClient.prototype.updateSecret = function(secretIdentifier, request, callback) { - var result = this._secrets.update(secretIdentifier, serializeSecretRequest(request), secretBundleResponseDeserializer(callback)); - return result; -}; - -/** - * Performs a DELETE SECRET operation, which deletes a secret and all its versions. - * This method returns data about the current version of the deleted secret. - * - * @param {string} vault The vault identifier. - * @param {string} secretName The secret name. - * @param {KeyVaultClient~secretBundleCallback} callback A callback that will be called on completion. - */ -KeyVaultClient.prototype.deleteSecret = function(vault, secretName, callback) { - var secretIdentifier = createSecretIdentifier(vault, secretName).identifier; - var result = this._secrets.deleteMethod(secretIdentifier, secretBundleResponseDeserializer(callback)); - return result; -}; - -/** - * Performs a GET SECRETS operation, which lists secrets of a vault. - * This operation may use paging. Call {@linkcode #getSecretsNext} to retrieve more pages. - * - * @param {string} vault The vault identifier. - * @param {number} maxresults The maximum number of secrets to return. This is the total number of secrets, not the size of first page. - * @param {KeyVaultClient~secretListCallback} callback A callback that will be called on completion. - */ -KeyVaultClient.prototype.getSecrets = function(vault, maxresults, callback) { - var result = this._secrets.list(vault, maxresults, secretListResponseDeserializer(callback)); - return result; -}; - -/** - * Resumes a GET SECRETS operation by returning the next page. - * - * @param {string} nextLink The value returned by a previous call to {@linkcode #getSecrets} or {@linkcode #getSecretsNext}. - * @param {KeyVaultClient~secretListCallback} callback A callback that will be called on completion. - */ -KeyVaultClient.prototype.getSecretsNext = function(nextLink, callback) { - var result = this._secrets.listNext(nextLink, secretListResponseDeserializer(callback)); - return result; -}; - -/** - * Performs a GET SECRET VERSIONS operation, which lists all versions of a secret. - * This operation may use paging. Call {@linkcode #getSecretVersionsNext} to retrieve more pages. - * - * @param {string} vault The vault identifier. - * @param {string} secretName The secret name. - * @param {number} maxresults The maximum number of secret versions to return. This is the total number of items, not the size of first page. - * @param {KeyVaultClient~secretListCallback} callback A callback that will be called on completion. - */ -KeyVaultClient.prototype.getSecretVersions = function(vault, secretName, maxresults, callback) { - var result = this._secrets.listVersions(vault, secretName, maxresults, secretListResponseDeserializer(callback)); - return result; -}; - -/** - * Resumes a GET SECRET VERSIONS operation by returning the next page. - * - * @param {string} nextLink The value returned by a previous call to {@linkcode #getSecretVersions} or {@linkcode #getSecretVersionsNext}. - * @param {KeyVaultClient~secretListCallback} callback A callback that will be called on completion. - */ -KeyVaultClient.prototype.getSecretVersionsNext = function(nextLink, callback) { - var result = this._secrets.listVersionsNext(nextLink, secretListResponseDeserializer(callback)); - return result; -}; - -// Callback definitions - -/** - * @callback KeyVaultClient~valueCallback - * @param {object} [err] Error information. Only informed if the operation was not successful. - * @param {object} [result] The operation result. Only informed on success. - * @param {string} result.kid Identifier of the key used to perform the operation. - * @param {Buffer} result.value The operation result. The content is defined by the operation. - */ - -/** - * @callback KeyVaultClient~boolCallback - * @param {object} [err] Error information. Only informed if the operation was not successful. - * @param {object} [result] The operation result. Only informed on success. - * @param {string} result.kid Identifier of the key used to perform the operation. - * @param {bool} result.value The operation result. - */ - -/** - * @callback KeyVaultClient~keyBundleCallback - * @param {object} [err] Error information. Only informed if the operation was not successful. - * @param {KeyBundle} [result] An object describing a key stored in the service. Only informed on success. - */ - -/** - * @callback KeyVaultClient~keyListCallback - * @param {object} [err] Error information. Only informed if the operation was not successful. - * @param {object} [result] An object describing a list of keys stored in the service. Only informed on success. - * @param {object[]} result.value An array of objects, each describing a key stored in the service. - * @param {string} result.value[].kid The key identifier. - * @param {KeyAttributes} result.value[].attributes The key attributes. - * @param {string} [result.nextLink] An optional string containing the continuation link, if more pages are available in the service. - */ - -/** - * @callback KeyVaultClient~secretBundleCallback - * @param {object} [err] Error information. Only informed if the operation was not successful. - * @param {SecretBundle} [result] An object describing a secret stored in the service. Only informed on success. - */ - -/** - * @callback KeyVaultClient~secretListCallback - * @param {object} [err] Error information. Only informed if the operation was not successful. - * @param {object} [result] An object describing a list of secrets stored in the service. Only informed on success. - * @param {object[]} result.value An array of objects, each describing a secret stored in the service. - * @param {string} result.value[].id The secret identifier. - * @param {SecretAttributes} result.value[].attributes The secret attributes. - * @param {string} [result.nextLink] An optional string containing the continuation link, if more pages are available in the service. - */ - -/** An identifier for an Azure Key Vault resource. - * @class - */ -function ObjectIdentifier(collection, vault, name, version) { - - /** The vault URI. - * @member {string} - */ - this.vault = vault; - - /** The key name. - * @member {string} - */ - this.name = name; - - /** The key version. May be null. - * @member {string} - */ - this.version = version; - - /** The base identifier (i.e. without the version). - * @member {string} - */ - this.baseIdentifier = util.format('%s/%s/%s', vault, collection, name); - - /** The full identifier if a version was informed; otherwise is the same value of baseIdentifier. - * @member {string} - */ - this.identifier = version ? util.format('%s/%s', this.baseIdentifier, version) : this.baseIdentifier; -} - -function createObjectIdentifier(collection, vault, name, version) { - - if (!_.isString(collection) || !(collection = collection.trim())) { - throw new Error('Invalid collection argument'); - } - - if (!_.isString(vault) || !(vault = vault.trim())) { - throw new Error('Invalid vault argument'); - } - - if (!_.isString(name) || !(name = name.trim())) { - throw new Error('Invalid name argument'); - } - - if (version && !_.isString(version)) { - throw new Error('Invalid version argument'); - } - - if (version) { - version = version.trim(); - } - - if (!version) { - version = null; - } - - var baseUri; - try { - baseUri = url.parse(vault, true, true); - } catch (e) { - throw new Error(util.format('Invalid %s identifier: %s. Not a valid URI', collection, vault)); - } - - var vault = util.format('%s//%s', baseUri.protocol, baseUri.host); - return new ObjectIdentifier(collection, vault, name, version); -} - -/** Creates an ObjectIdentifier object for a key. - @param {string} vault The vault URI. - @param {string} name The key name. - @param {string} [version=null] The object version. - @return {ObjectIdentifier} An object that represents the key identifier. -*/ -function createKeyIdentifier(vault, name, version) { - return createObjectIdentifier('keys', vault, name, version); -} - -exports.createKeyIdentifier = createKeyIdentifier; - -/** Creates an ObjectIdentifier object for a secret. - @param {string} vault The vault URI. - @param {string} name The secret name. - @param {string} [version=null] The object version. - @return {ObjectIdentifier} An object that represents the secret identifier. -*/ -function createSecretIdentifier(vault, name, version) { - return createObjectIdentifier('secrets', vault, name, version); -} - -exports.createSecretIdentifier = createSecretIdentifier; - -function parseObjectIdentifier(collection, identifier) { - - if (!_.isString(collection) || !(collection = collection.trim())) { - throw new Error('Invalid collection argument'); - } - - if (!_.isString(identifier) || !(identifier = identifier.trim())) { - throw new Error('Invalid identifier argument'); - } - - var baseUri; - try { - baseUri = url.parse(identifier, true, true); - } catch (e) { - throw new Error(util.format('Invalid %s identifier: %s. Not a valid URI', collection, identifier)); - } - - // Path is of the form '/collection/name[/version]' - var segments = baseUri.pathname.split('/'); - if (segments.length !== 3 && segments.length !== 4) { - throw new Error(util.format('Invalid %s identifier: %s. Bad number of segments: %d', collection, identifier, segments.length)); - } - - if (collection !== segments[1]) { - throw new Error(util.format('Invalid %s identifier: %s. segment [1] should be "%s", found "%s"', collection, identifier, collection, segments[1])); - } - - var vault = util.format('%s//%s', baseUri.protocol, baseUri.host); - var name = segments[2]; - var version = segments.length === 4 ? segments[3] : null; - return new ObjectIdentifier(collection, vault, name, version); -} - -/** Parses a string containing a key identifier and returns the ObjectIdentifier object. - @param {string} identifier The key identifier (an URI). - @return {ObjectIdentifier} An object that represents the key identifier. -*/ -function parseKeyIdentifier(identifier) { - return parseObjectIdentifier('keys', identifier); -} - -exports.parseKeyIdentifier = parseKeyIdentifier; - -/** Parses a string containing a secret identifier and returns the ObjectIdentifier object. - @param {string} identifier The secret identifier (an URI). - @return {ObjectIdentifier} An object that represents the secret identifier. -*/ -function parseSecretIdentifier(identifier) { - return parseObjectIdentifier('secrets', identifier); -} - -exports.parseSecretIdentifier = parseSecretIdentifier; - -/** @class - */ -function KeyBundle() { - /** The JWK object containig key information. - * @member {JsonWebKey} - */ - this.key = null; - - /** Key attributes. - * @member {KeyAttributes} - */ - this.attributes = null; - - /** User defined tags. Each tag must be a string. - * @member {object} - */ - this.tags = null; - + this._internalClient = new InternalClient(credentials, options); } -/** @class - */ -function KeyAttributes() { - - /** true if the object is explicitly enabled, false otherwise. - * @member {boolean} - */ - this.enabled = null; - - /** Date when the object was created in the service. - * @member {Date} - */ - this.created = null; - - /** Last time the object was updated in the service. - * @member {Date} - */ - this.updated = null; - - /** The date when the object becomes available for operations (the "not-before" date). - * @member {Date} - */ - this.nbf = null; - - /** The date when the object becomes unavailable for operations (the "expiration" date). - * @member {Date} - */ - this.exp = null; - -} - -exports.KeyAttributes = KeyAttributes; - -KeyAttributes.fromJson = function(json) { - var result = new KeyAttributes(); - result.enabled = json.enabled; - result.created = numberToDate(json.created); - result.updated = numberToDate(json.updated); - result.nbf = numberToDate(json.nbf); - result.exp = numberToDate(json.exp); - return result; +/** + * Creates a new {@linkcode KeyVaultClient} object. + * + * @param {object} [credentials] The credentials, typically a {@linkcode KeyVaultCredentials} object. If null, an authentication filter must be provided. + + * @param {object} [options] - The parameter options + * + * @param {Array} [options.filters] - Filters to be added to the request pipeline + * + * @param {object} [options.requestOptions] - Options for the underlying request object + * {@link https://github.com/request/request#requestoptions-callback Options doc} + * + * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy + * + * @param {string} [options.apiVersion] - Client Api Version. + * + * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. + * + * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + */ +module.exports.createKeyVaultClient = function (credentials, options) { + return new module.exports.KeyVaultClient(credentials, options); }; -KeyAttributes.prototype.toJson = function() { - var result = {}; - result.enabled = this.enabled; - result.created = dateToNumber(this.created); - result.updated = dateToNumber(this.updated); - result.nbf = dateToNumber(this.nbf); - result.exp = dateToNumber(this.exp); - return result; +/** + * Creates a new, named, key in the specified vault. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} keyName The name of the key + * + * @param {string} kty The type of key to create. Valid key types, see + * JsonWebKeyType. Possible values include: 'EC', 'RSA', 'RSA-HSM', 'oct' + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.keySize] The key size in bytes. e.g. 1024 or 2048. + * + * @param {array} [options.keyOps] + * + * @param {object} [options.keyAttributes] + * + * @param {boolean} [options.keyAttributes.enabled] Determines whether the + * object is enabled + * + * @param {date} [options.keyAttributes.notBefore] Not before date in UTC + * + * @param {date} [options.keyAttributes.expires] Expiry date in UTC + * + * @param {object} [options.tags] Application-specific metadata in the form of + * key-value pairs + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link KeyBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.createKey = function (vaultBaseUrl, keyName, keyType, options, callback) { + return this._internalClient.createKey(vaultBaseUrl, keyName, keyType, options, callback); }; -/** @class - */ -function SecretBundle() { - - /** The secret identifier. - * @member {string} - */ - this.id = null; - - /** The contents that must be protected (the secret value). - * @member {string} - */ - this.value = null; - - /** The content type. - * @member {string} - */ - this.contentType = null; - - /** The secret attributes. - * @member {SecretAttributes} - */ - this.attributes = null; - - /** User defined tags. Each tag must be a string. - * @member {object} - */ - this.tags = null; - -} - -/** @class - */ -function SecretAttributes() { - - /** true if the object is explicitly enabled, false otherwise. - * @member {boolean} - */ - this.enabled = null; - - /** Date when the object was created in the service. - * @member {Date} - */ - this.created = null; - - /** Last time the object was updated in the service. - * @member {Date} - */ - this.updated = null; - - /** The date when the object becomes available for operations (the "not-before" date). - * @member {Date} - */ - this.nbf = null; - - /** The date when the object becomes unavailable for operations (the "expiration" date). - * @member {Date} - */ - this.exp = null; - -} - -exports.SecretAttributes = SecretAttributes; - -SecretAttributes.fromJson = function(json) { - var result = new SecretAttributes(); - result.enabled = json.enabled; - result.created = numberToDate(json.created); - result.updated = numberToDate(json.updated); - result.nbf = numberToDate(json.nbf); - result.exp = numberToDate(json.exp); - return result; +/** + * Imports a key into the specified vault + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} keyName The name of the key + * + * @param {object} key The Json web key + * + * @param {string} [key.kid] Key Identifier + * + * @param {string} [key.kty] Key type, usually RSA. Possible values include: + * 'EC', 'RSA', 'RSA-HSM', 'oct' + * + * @param {array} [key.keyOps] + * + * @param {buffer} [key.n] RSA modulus + * + * @param {buffer} [key.e] RSA public exponent + * + * @param {buffer} [key.d] RSA private exponent + * + * @param {buffer} [key.dp] RSA Private Key Parameter + * + * @param {buffer} [key.dq] RSA Private Key Parameter + * + * @param {buffer} [key.qi] RSA Private Key Parameter + * + * @param {buffer} [key.p] RSA secret prime + * + * @param {buffer} [key.q] RSA secret prime, with p < q + * + * @param {buffer} [key.k] Symmetric key + * + * @param {buffer} [key.t] HSM Token, used with Bring Your Own Key + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.hsm] Whether to import as a hardware key (HSM) or + * software key + * + * @param {object} [options.keyAttributes] The key management attributes + * + * @param {boolean} [options.keyAttributes.enabled] Determines whether the + * object is enabled + * + * @param {date} [options.keyAttributes.notBefore] Not before date in UTC + * + * @param {date} [options.keyAttributes.expires] Expiry date in UTC + * + * @param {object} [options.tags] Application-specific metadata in the form of + * key-value pairs + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link KeyBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.importKey = function (vaultBaseUrl, keyName, key, options, callback) { + return this._internalClient.importKey(vaultBaseUrl, keyName, key, options, callback); }; -SecretAttributes.prototype.toJson = function() { - var result = {}; - result.enabled = this.enabled; - result.created = dateToNumber(this.created); - result.updated = dateToNumber(this.updated); - result.nbf = dateToNumber(this.nbf); - result.exp = dateToNumber(this.exp); - return result; +/** + * Deletes the specified key + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} keyName The name of the key + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link KeyBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.deleteKey = function (vaultBaseUrl, keyName, options, callback) { + return this._internalClient.deleteKey(vaultBaseUrl, keyName, options, callback); }; -function createKeyOpRequest(algorithm, data) { - var request = {}; - request.alg = algorithm; - request.value = bufferToBase64Url(data); - return request; -} +/** + * Updates the Key Attributes associated with the specified key + * + * @param {string} keyIdentifier The key identifier. It may or may not contain a version path. If a version is not provided, the latest key version is used. + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.keyOps] Json web key operations. For more + * information on possible key operations, see JsonWebKeyOperation. + * + * @param {object} [options.keyAttributes] + * + * @param {boolean} [options.keyAttributes.enabled] Determines whether the + * object is enabled + * + * @param {date} [options.keyAttributes.notBefore] Not before date in UTC + * + * @param {date} [options.keyAttributes.expires] Expiry date in UTC + * + * @param {object} [options.tags] Application-specific metadata in the form of + * key-value pairs + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link KeyBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.updateKey = function (keyIdentifier, options, callback) { + var parsedId = objId.parseKeyIdentifier(keyIdentifier); + var version = (parsedId.version === null) ? '' : parsedId.version; + return this._internalClient.updateKey(parsedId.vault, parsedId.name, version, options, callback); +}; -function createVerifyOpRequest(algorithm, digest, signature) { - var request = {}; - request.alg = algorithm; - request.digest = bufferToBase64Url(digest); - request.value = bufferToBase64Url(signature); - return request; -} +/** + * Retrieves the public portion of a key plus its attributes + * + * @param {string} keyIdentifier The key identifier. It may or may not contain a version path. If a version is not provided, the latest key version is used. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link KeyBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getKey = function (keyIdentifier, options, callback) { + var parsedId = objId.parseKeyIdentifier(keyIdentifier); + var version = (parsedId.version === null) ? '' : parsedId.version; + return this._internalClient.getKey(parsedId.vault, parsedId.name, version, options, callback); +}; -function createRestoreKeyRequest(backupValue) { - var request = {}; - request.value = bufferToBase64Url(backupValue); - return request; -} +/** + * List the versions of the specified key + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} keyName The name of the key + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link KeyListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getKeyVersions = function (vaultBaseUrl, keyName, options, callback) { + return this._internalClient.getKeyVersions(vaultBaseUrl, keyName, options, callback); +}; -function serializeImportKeyRequest(request) { - var result = { rawJsonRequest: JSON.stringify(request) }; - if (request.key || request.attributes) { - result = JSON.parse(result.rawJsonRequest); - if (request.key) { - result.key = jwkToJson(request.key); +/** + * List keys in the specified vault + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link KeyListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getKeys = function (vaultBaseUrl, options, callback) { + return this._internalClient.getKeys(vaultBaseUrl, options, callback); +}; + +/** + * Requests that a backup of the specified key be downloaded to the client. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} keyName The name of the key + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link BackupKeyResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.backupKey = function (vaultBaseUrl, keyName, options, callback) { + return this._internalClient.backupKey(vaultBaseUrl, keyName, options, callback); +}; + +/** + * Restores the backup key in to a vault + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {buffer} keyBundleBackup the backup blob associated with a key bundle + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link KeyBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.restoreKey = function (vaultBaseUrl, keyBundleBackup, options, callback) { + return this._internalClient.restoreKey(vaultBaseUrl, keyBundleBackup, options, callback); +}; + +/** + * Encrypts an arbitrary sequence of bytes using an encryption key that is + * stored in Azure Key Vault. + * + * @param {string} keyIdentifier The key identifier. It may or may not contain a version path. If a version is not provided, the latest key version is used. + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA1_5' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link KeyOperationResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.encrypt = function (keyIdentifier, algorithm, value, options, callback) { + var parsedId = objId.parseKeyIdentifier(keyIdentifier); + var version = (parsedId.version === null) ? '' : parsedId.version; + return this._internalClient.encrypt(parsedId.vault, parsedId.name, version, algorithm, value, options, callback); +}; + +/** + * Decrypts a single block of encrypted data + * + * @param {string} keyIdentifier The key identifier. It may or may not contain a version path. If a version is not provided, the latest key version is used. + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA1_5' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link KeyOperationResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.decrypt = function (keyIdentifier, algorithm, value, options, callback) { + var parsedId = objId.parseKeyIdentifier(keyIdentifier); + var version = (parsedId.version === null) ? '' : parsedId.version; + return this._internalClient.decrypt(parsedId.vault, parsedId.name, version, algorithm, value, options, callback); +}; + +/** + * Creates a signature from a digest using the specified key in the vault + * + * @param {string} keyIdentifier The key identifier. It may or may not contain a version path. If a version is not provided, the latest key version is used. + * + * @param {string} algorithm algorithm identifier + * @param {string} algorithm The signing/verification algorithm identifier. + * For more information on possible algorithm types, see + * JsonWebKeySignatureAlgorithm. Possible values include: 'RS256', 'RS384', + * 'RS512', 'RSNULL' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link KeyOperationResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.sign = function (keyIdentifier, algorithm, value, options, callback) { + var parsedId = objId.parseKeyIdentifier(keyIdentifier); + var version = (parsedId.version === null) ? '' : parsedId.version; + return this._internalClient.sign(parsedId.vault, parsedId.name, version, algorithm, value, options, callback); +}; + +/** + * Verifies a signature using the specified key + * + * @param {string} keyIdentifier The key identifier. It may or may not contain a version path. If a version is not provided, the latest key version is used. + * + * @param {string} algorithm The signing/verification algorithm. For more + * information on possible algorithm types, see JsonWebKeySignatureAlgorithm. + * Possible values include: 'RS256', 'RS384', 'RS512', 'RSNULL' + * + * @param {buffer} digest The digest used for signing + * + * @param {buffer} signature The signature to be verified + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link KeyVerifyResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.verify = function (keyIdentifier, algorithm, digest, signature, options, callback) { + var parsedId = objId.parseKeyIdentifier(keyIdentifier); + var version = (parsedId.version === null) ? '' : parsedId.version; + return this._internalClient.verify(parsedId.vault, parsedId.name, version, algorithm, digest, signature, options, callback); +}; + +/** + * Wraps a symmetric key using the specified key + * + * @param {string} keyIdentifier The key identifier. It may or may not contain a version path. If a version is not provided, the latest key version is used. + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA1_5' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link KeyOperationResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.wrapKey = function (keyIdentifier, algorithm, value, options, callback) { + var parsedId = objId.parseKeyIdentifier(keyIdentifier); + var version = (parsedId.version === null) ? '' : parsedId.version; + return this._internalClient.wrapKey(parsedId.vault, parsedId.name, version, algorithm, value, options, callback); +}; + +/** + * Unwraps a symmetric key using the specified key in the vault that has + * initially been used for wrapping the key. + * + * @param {string} keyIdentifier The key identifier. It may or may not contain a version path. If a version is not provided, the latest key version is used. + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA1_5' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link KeyOperationResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.unwrapKey = function (keyIdentifier, algorithm, value, options, callback) { + var parsedId = objId.parseKeyIdentifier(keyIdentifier); + var version = (parsedId.version === null) ? '' : parsedId.version; + return this._internalClient.unwrapKey(parsedId.vault, parsedId.name, version, algorithm, value, options, callback); +}; + +/** + * Sets a secret in the specified vault. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} secretName The name of the secret in the given vault + * + * @param {string} value The value of the secret + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.tags] Application-specific metadata in the form of + * key-value pairs + * + * @param {string} [options.contentType] Type of the secret value such as a + * password + * + * @param {object} [options.secretAttributes] The secret management attributes + * + * @param {boolean} [options.secretAttributes.enabled] Determines whether the + * object is enabled + * + * @param {date} [options.secretAttributes.notBefore] Not before date in UTC + * + * @param {date} [options.secretAttributes.expires] Expiry date in UTC + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link SecretBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.setSecret = function (vaultBaseUrl, secretName, value, options, callback) { + return this._internalClient.setSecret(vaultBaseUrl, secretName, value, options, callback); +}; + +/** + * Deletes a secret from the specified vault. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} secretName The name of the secret in the given vault + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link SecretBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.deleteSecret = function (vaultBaseUrl, secretName, options, callback) { + return this._internalClient.deleteSecret(vaultBaseUrl, secretName, options, callback); +}; + +/** + * Updates the attributes associated with the specified secret + * + * @param {string} secretIdentifier The secret identifier. It may or may not contain a version path. If a version is not provided, the latest secret version is used. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.contentType] Type of the secret value such as a + * password + * + * @param {object} [options.secretAttributes] The secret management attributes + * + * @param {boolean} [options.secretAttributes.enabled] Determines whether the + * object is enabled + * + * @param {date} [options.secretAttributes.notBefore] Not before date in UTC + * + * @param {date} [options.secretAttributes.expires] Expiry date in UTC + * + * @param {object} [options.tags] Application-specific metadata in the form of + * key-value pairs + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link SecretBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.updateSecret = function (secretIdentifier, options, callback) { + var parsedId = objId.parseSecretIdentifier(secretIdentifier); + var version = (parsedId.version === null) ? '' : parsedId.version; + return this._internalClient.updateSecret(parsedId.vault, parsedId.name, version, options, callback); +}; + +/** + * Gets a secret. + * + * @param {string} secretIdentifier The secret identifier. It may or may not contain a version path. If a version is not provided, the latest secret version is used. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link SecretBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getSecret = function (secretIdentifier, options, callback) { + var parsedId = objId.parseSecretIdentifier(secretIdentifier); + var version = (parsedId.version === null) ? '' : parsedId.version; + return this._internalClient.getSecret(parsedId.vault, parsedId.name, version, options, callback); +}; + +/** + * List secrets in the specified vault + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of secrets to return. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link SecretListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getSecrets = function (vaultBaseUrl, options, callback) { + return this._internalClient.getSecrets(vaultBaseUrl, options, callback); +}; + +/** + * List the versions of the specified secret + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} secretName The name of the secret in the given vault + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link SecretListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getSecretVersions = function (vaultBaseUrl, secretName, options, callback) { + return this._internalClient.getSecretVersions(vaultBaseUrl, secretName, options, callback); +}; + +/** + * List certificates in the specified vault + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link CertificateListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getCertificates = function (vaultBaseUrl, options, callback) { + return this._internalClient.getCertificates(vaultBaseUrl, options, callback); +}; + +/** + * Deletes a certificate from the specified vault. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} certificateName The name of the certificate in the given + * vault + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link CertificateBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.deleteCertificate = function (vaultBaseUrl, certificateName, options, callback) { + return this._internalClient.deleteCertificate(vaultBaseUrl, certificateName, options, callback); +}; + +/** + * Sets the certificate contacts for the specified vault. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {object} contacts The contacts for the vault certificates. + * + * @param {array} [contacts.contactList] The contact list for the vault + * certificates. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link Contacts} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.setCertificateContacts = function (vaultBaseUrl, contacts, options, callback) { + return this._internalClient.setCertificateContacts(vaultBaseUrl, contacts, options, callback); +}; + +/** + * Gets the certificate contacts for the specified vault. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link Contacts} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getCertificateContacts = function (vaultBaseUrl, options, callback) { + return this._internalClient.getCertificateContacts(vaultBaseUrl, options, callback); +}; + +/** + * Deletes the certificate contacts for the specified vault. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link Contacts} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.deleteCertificateContacts = function (vaultBaseUrl, options, callback) { + return this._internalClient.deleteCertificateContacts(vaultBaseUrl, options, callback); +}; + +/** + * List certificate issuers for the specified vault. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link CertificateIssuerListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getCertificateIssuers = function (vaultBaseUrl, options, callback) { + return this._internalClient.getCertificateIssuers(vaultBaseUrl, options, callback); +}; + +/** + * Sets the specified certificate issuer. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} issuerName The name of the issuer. + * + * @param {object} issuer The issuer bundle. + * + * @param {string} [issuer.provider] The name of the issuer. + * + * @param {object} [issuer.credentials] The credentials to be used for the + * issuer. + * + * @param {string} [issuer.credentials.accountId] The user name/account + * name/account id. + * + * @param {string} [issuer.credentials.password] The password/secret/account + * key. + * + * @param {object} [issuer.organizationDetails] Details of the organization as + * provided to the issuer. + * + * @param {string} [issuer.organizationDetails.id] Id of the organization. + * + * @param {array} [issuer.organizationDetails.adminDetails] Details of the + * organization administrator. + * + * @param {object} [issuer.attributes] Attributes of the issuer object. + * + * @param {boolean} [issuer.attributes.enabled] Determines whether the issuer + * is enabled + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link IssuerBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.setCertificateIssuer = function (vaultBaseUrl, issuerName, issuer, options, callback) { + return this._internalClient.setCertificateIssuer(vaultBaseUrl, issuerName, issuer, options, callback); +}; + +/** + * Updates the specified certificate issuer. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} issuerName The name of the issuer. + * + * @param {object} issuer The issuer bundle. + * + * @param {string} [issuer.provider] The name of the issuer. + * + * @param {object} [issuer.credentials] The credentials to be used for the + * issuer. + * + * @param {string} [issuer.credentials.accountId] The user name/account + * name/account id. + * + * @param {string} [issuer.credentials.password] The password/secret/account + * key. + * + * @param {object} [issuer.organizationDetails] Details of the organization as + * provided to the issuer. + * + * @param {string} [issuer.organizationDetails.id] Id of the organization. + * + * @param {array} [issuer.organizationDetails.adminDetails] Details of the + * organization administrator. + * + * @param {object} [issuer.attributes] Attributes of the issuer object. + * + * @param {boolean} [issuer.attributes.enabled] Determines whether the issuer + * is enabled + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link IssuerBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.updateCertificateIssuer = function (vaultBaseUrl, issuerName, issuer, options, callback) { + return this._internalClient.updateCertificateIssuer(vaultBaseUrl, issuerName, issuer, options, callback); +}; + +/** + * Gets the specified certificate issuer. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} issuerName The name of the issuer. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link IssuerBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getCertificateIssuer = function (vaultBaseUrl, issuerName, options, callback) { + return this._internalClient.getCertificateIssuer(vaultBaseUrl, issuerName, options, callback); +}; + +/** + * Deletes the specified certificate issuer. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} issuerName The name of the issuer. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link IssuerBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.deleteCertificateIssuer = function (vaultBaseUrl, issuerName, options, callback) { + return this._internalClient.deleteCertificateIssuer(vaultBaseUrl, issuerName, options, callback); +}; + +/** + * Creates a new certificate version. If this is the first version, the + * certificate resource is created. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} certificateName The name of the certificate + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.certificatePolicy] The management policy for the + * certificate + * + * @param {object} [options.certificatePolicy.keyProperties] Properties of the + * key backing a certificate. + * + * @param {boolean} [options.certificatePolicy.keyProperties.exportable] + * Indicates if the private key can be exported. + * + * @param {string} [options.certificatePolicy.keyProperties.keyType] The key + * type. + * + * @param {number} [options.certificatePolicy.keyProperties.keySize] The key + * size in bytes. e.g. 1024 or 2048. + * + * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] + * Indicates if the same key pair will be used on certificate renewal. + * + * @param {object} [options.certificatePolicy.secretProperties] Properties of + * the secret backing a certificate. + * + * @param {string} [options.certificatePolicy.secretProperties.contentType] + * The media type (MIME type). + * + * @param {object} [options.certificatePolicy.x509CertificateProperties] + * Properties of the X509 component of a certificate. + * + * @param {string} + * [options.certificatePolicy.x509CertificateProperties.subject] The subject + * name. Should be a valid X509 Distinguished Name. + * + * @param {array} [options.certificatePolicy.x509CertificateProperties.ekus] + * The enhaunced key usage. + * + * @param {object} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames] + * The subject alternative names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.keyUsage] List of key + * usages. + * + * @param {number} + * [options.certificatePolicy.x509CertificateProperties.validityInMonths] The + * subject alternate names. + * + * @param {array} [options.certificatePolicy.lifetimeActions] Actions that + * will be performed by Key Vault over the lifetime of a certificate. + * + * @param {object} [options.certificatePolicy.issuerReference] Reference to + * the issuer of the X509 component of a certificate. + * + * @param {string} [options.certificatePolicy.issuerReference.name] Name of + * the referenced issuer object. + * + * @param {object} [options.certificatePolicy.attributes] The certificate + * attributes. + * + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional) + * + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled + * + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC + * + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC + * + * @param {object} [options.tags] Application-specific metadata in the form of + * key-value pairs + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link CertificateOperation} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.createCertificate = function (vaultBaseUrl, certificateName, options, callback) { + return this._internalClient.createCertificate(vaultBaseUrl, certificateName, options, callback); +}; + +/** + * Imports a certificate into the specified vault + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} certificateName The name of the certificate + * + * @param {string} base64EncodedCertificate Base64 encoded representation of + * the certificate object to import. This certificate needs to contain the + * private key. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.password] If the private key in + * base64EncodedCertificate is encrypted, the password used for encryption + * + * @param {object} [options.certificatePolicy] The management policy for the + * certificate + * + * @param {object} [options.certificatePolicy.keyProperties] Properties of the + * key backing a certificate. + * + * @param {boolean} [options.certificatePolicy.keyProperties.exportable] + * Indicates if the private key can be exported. + * + * @param {string} [options.certificatePolicy.keyProperties.keyType] The key + * type. + * + * @param {number} [options.certificatePolicy.keyProperties.keySize] The key + * size in bytes. e.g. 1024 or 2048. + * + * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] + * Indicates if the same key pair will be used on certificate renewal. + * + * @param {object} [options.certificatePolicy.secretProperties] Properties of + * the secret backing a certificate. + * + * @param {string} [options.certificatePolicy.secretProperties.contentType] + * The media type (MIME type). + * + * @param {object} [options.certificatePolicy.x509CertificateProperties] + * Properties of the X509 component of a certificate. + * + * @param {string} + * [options.certificatePolicy.x509CertificateProperties.subject] The subject + * name. Should be a valid X509 Distinguished Name. + * + * @param {array} [options.certificatePolicy.x509CertificateProperties.ekus] + * The enhaunced key usage. + * + * @param {object} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames] + * The subject alternative names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.keyUsage] List of key + * usages. + * + * @param {number} + * [options.certificatePolicy.x509CertificateProperties.validityInMonths] The + * subject alternate names. + * + * @param {array} [options.certificatePolicy.lifetimeActions] Actions that + * will be performed by Key Vault over the lifetime of a certificate. + * + * @param {object} [options.certificatePolicy.issuerReference] Reference to + * the issuer of the X509 component of a certificate. + * + * @param {string} [options.certificatePolicy.issuerReference.name] Name of + * the referenced issuer object. + * + * @param {object} [options.certificatePolicy.attributes] The certificate + * attributes. + * + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional) + * + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled + * + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC + * + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC + * + * @param {object} [options.tags] Application-specific metadata in the form of + * key-value pairs + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link CertificateBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.importCertificate = function (vaultBaseUrl, certificateName, base64EncodedCertificate, options, callback) { + return this._internalClient.importCertificate(vaultBaseUrl, certificateName, base64EncodedCertificate, options, callback); +}; + +/** + * List the versions of a certificate. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} certificateName The name of the certificate + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link CertificateListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getCertificateVersions = function (vaultBaseUrl, certificateName, options, callback) { + return this._internalClient.getCertificateVersions(vaultBaseUrl, certificateName, options, callback); +}; + +/** + * Gets the policy for a certificate. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} certificateName The name of the certificate in the given + * vault. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link CertificatePolicy} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getCertificatePolicy = function (vaultBaseUrl, certificateName, options, callback) { + return this._internalClient.getCertificatePolicy(vaultBaseUrl, certificateName, options, callback); +}; + +/** + * Updates the policy for a certificate. Set appropriate members in the + * certificatePolicy that must be updated. Leave others as null. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} certificateName The name of the certificate in the given + * vault. + * + * @param {object} certificatePolicy The policy for the certificate. + * + * @param {object} [certificatePolicy.keyProperties] Properties of the key + * backing a certificate. + * + * @param {boolean} [certificatePolicy.keyProperties.exportable] Indicates if + * the private key can be exported. + * + * @param {string} [certificatePolicy.keyProperties.keyType] The key type. + * + * @param {number} [certificatePolicy.keyProperties.keySize] The key size in + * bytes. e.g. 1024 or 2048. + * + * @param {boolean} [certificatePolicy.keyProperties.reuseKey] Indicates if + * the same key pair will be used on certificate renewal. + * + * @param {object} [certificatePolicy.secretProperties] Properties of the + * secret backing a certificate. + * + * @param {string} [certificatePolicy.secretProperties.contentType] The media + * type (MIME type). + * + * @param {object} [certificatePolicy.x509CertificateProperties] Properties of + * the X509 component of a certificate. + * + * @param {string} [certificatePolicy.x509CertificateProperties.subject] The + * subject name. Should be a valid X509 Distinguished Name. + * + * @param {array} [certificatePolicy.x509CertificateProperties.ekus] The + * enhaunced key usage. + * + * @param {object} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames] The + * subject alternative names. + * + * @param {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @param {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * + * @param {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @param {array} [certificatePolicy.x509CertificateProperties.keyUsage] List + * of key usages. + * + * @param {number} + * [certificatePolicy.x509CertificateProperties.validityInMonths] The subject + * alternate names. + * + * @param {array} [certificatePolicy.lifetimeActions] Actions that will be + * performed by Key Vault over the lifetime of a certificate. + * + * @param {object} [certificatePolicy.issuerReference] Reference to the issuer + * of the X509 component of a certificate. + * + * @param {string} [certificatePolicy.issuerReference.name] Name of the + * referenced issuer object. + * + * @param {object} [certificatePolicy.attributes] The certificate attributes. + * + * @param {boolean} [certificatePolicy.attributes.enabled] Determines whether + * the object is enabled + * + * @param {date} [certificatePolicy.attributes.notBefore] Not before date in + * UTC + * + * @param {date} [certificatePolicy.attributes.expires] Expiry date in UTC + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link CertificatePolicy} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.updateCertificatePolicy = function (vaultBaseUrl, certificateName, certificatePolicy, options, callback) { + return this._internalClient.updateCertificatePolicy(vaultBaseUrl, certificateName, certificatePolicy, options, callback); +}; + +/** + * Updates the attributes associated with the specified certificate + * + * @param {string} certificateIdentifier The certificate identifier. It may or may not contain a version path. If a version is not provided, the latest certificate version is used. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional) + * + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled + * + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC + * + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC + * + * @param {object} [options.tags] Application-specific metadata in the form of + * key-value pairs + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link CertificateBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.updateCertificate = function (certificateIdentifier, options, callback) { + var parsedId = objId.parseCertificateIdentifier(certificateIdentifier); + var version = (parsedId.version === null) ? '' : parsedId.version; + return this._internalClient.updateCertificate(parsedId.vault, parsedId.name, version, options, callback); +}; + +/** + * Gets a Certificate. + * + * @param {string} certificateIdentifier The certificate identifier. It may or may not contain a version path. If a version is not provided, the latest certificate version is used. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link CertificateBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getCertificate = function (certificateIdentifier, options, callback) { + var parsedId = objId.parseCertificateIdentifier(certificateIdentifier); + var version = (parsedId.version === null) ? '' : parsedId.version; + return this._internalClient.getCertificate(parsedId.vault, parsedId.name, version, options, callback); +}; + +/** + * Updates a certificate operation. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} certificateName The name of the certificate + * + * @param {object} certificateOperation The certificate operation response. + * + * @param {object} [certificateOperation.issuerReference] Reference to the + * issuer of the X509 component of a certificate. + * + * @param {string} [certificateOperation.issuerReference.name] Name of the + * referenced issuer object. + * + * @param {buffer} [certificateOperation.csr] The Certificate Signing Request + * (CSR) that is being used in the certificate operation. + * + * @param {boolean} [certificateOperation.cancellationRequested] Indicates if + * cancellation was requested on the certificate operation. + * + * @param {string} [certificateOperation.status] Status of the certificate + * operation. + * + * @param {string} [certificateOperation.statusDetails] The status details of + * the certificate operation. + * + * @param {object} [certificateOperation.error] Error encountered, if any, + * during the certificate operation. + * + * @param {string} [certificateOperation.target] Location which contains the + * result of the certificate operation. + * + * @param {string} [certificateOperation.requestId] Identifier for the + * certificate operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link CertificateOperation} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.updateCertificateOperation = function (vaultBaseUrl, certificateName, certificateOperation, options, callback) { + return this._internalClient.updateCertificateOperation(vaultBaseUrl, certificateName, certificateOperation, options, callback); +}; + +/** + * Gets the certificate operation response. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} certificateName The name of the certificate + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link CertificateOperation} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getCertificateOperation = function (vaultBaseUrl, certificateName, options, callback) { + return this._internalClient.getCertificateOperation(vaultBaseUrl, certificateName, options, callback); +}; + +/** + * Deletes the certificate operation. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} certificateName The name of the certificate + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link CertificateOperation} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.deleteCertificateOperation = function (vaultBaseUrl, certificateName, options, callback) { + return this._internalClient.deleteCertificateOperation(vaultBaseUrl, certificateName, options, callback); +}; + +/** + * Merges a certificate or a certificate chain with a key pair existing on the + * server. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} certificateName The name of the certificate + * + * @param {array} x509Certificates The certificate or the certificate chain to + * merge + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional) + * + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled + * + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC + * + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC + * + * @param {object} [options.tags] Application-specific metadata in the form of + * key-value pairs + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link CertificateBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.mergeCertificate = function (vaultBaseUrl, certificateName, x509Certificates, options, callback) { + return this._internalClient.mergeCertificate(vaultBaseUrl, certificateName, x509Certificates, options, callback); +}; + +/** + * List the versions of the specified key + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link KeyListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getKeyVersionsNext = function (nextPageLink, options, callback) { + return this._internalClient.getKeyVersionsNext(nextPageLink, options, callback); +}; + +/** + * List keys in the specified vault + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link KeyListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getKeysNext = function (nextPageLink, options, callback) { + return this._internalClient.getKeysNext(nextPageLink, options, callback); +}; + +/** + * List secrets in the specified vault + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link SecretListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getSecretsNext = function (nextPageLink, options, callback) { + return this._internalClient.getSecretsNext(nextPageLink, options, callback); +}; + +/** + * List the versions of the specified secret + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link SecretListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getSecretVersionsNext = function (nextPageLink, options, callback) { + return this._internalClient.getSecretVersionsNext(nextPageLink, options, callback); +}; + +/** + * List certificates in the specified vault + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link CertificateListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getCertificatesNext = function (nextPageLink, options, callback) { + return this._internalClient.getCertificatesNext(nextPageLink, options, callback); +}; + +/** + * List certificate issuers for the specified vault. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link CertificateIssuerListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getCertificateIssuersNext = function (nextPageLink, options, callback) { + return this._internalClient.getCertificateIssuersNext(nextPageLink, options, callback); +}; + +/** + * List the versions of a certificate. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link CertificateListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getCertificateVersionsNext = function (nextPageLink, options, callback) { + return this._internalClient.getCertificateVersionsNext(nextPageLink, options, callback); +}; + + +/** + * Gets the certificate operation response. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} certificateName The name of the certificate + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link CertificateOperation} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getPendingCertificateSigningRequest = function (vaultBaseUrl, certificateName, options, callback) { + var client = this._internalClient; + if (!callback && typeof options === 'function') { + callback = options; + options = null; } - if (request.attributes) { - result.attributes = request.attributes.toJson(); + if (!callback) { + throw new Error('callback cannot be null.'); } - result = { rawJsonRequest: JSON.stringify(result) }; - } - return result; -} - -function serializeKeyRequest(request) { - var result = { rawJsonRequest: JSON.stringify(request) }; - if (request.attributes) { - result = JSON.parse(result.rawJsonRequest); - result.attributes = request.attributes.toJson(); - result = { rawJsonRequest: JSON.stringify(result) }; - } - return result; -} - -function valueResponseDeserializer(callback) { - return keyResponseDeserializer(function(err, result, response) { - if (err || !result || !result.value) { - return callback(err, result, response); + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (certificateName === null || certificateName === undefined || typeof certificateName.valueOf() !== 'string') { + throw new Error('certificateName cannot be null or undefined and it must be of type string.'); + } + if (this._internalClient.apiVersion === null || this._internalClient.apiVersion === undefined || typeof this._internalClient.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this._internalClient.acceptLanguage !== null && this._internalClient.acceptLanguage !== undefined && typeof this._internalClient.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); } - result.value = base64UrlToBuffer(result.value); - return callback(err, result, response); - }); -} - -function keyBundleResponseDeserializer(callback) { - return keyResponseDeserializer(function(err, result, response) { - if (err || !result) { - return callback(err, result, response); + + // Construct URL + var requestUrl = this._internalClient.baseUri + + '//certificates/{certificate-name}/pending'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{certificate-name}', encodeURIComponent(certificateName)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this._internalClient.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); } - if (result.key) { - result.key = jwkFromJson(result.key); + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this._internalClient.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } - if (result.attributes) { - result.attributes = KeyAttributes.fromJson(result.attributes); + if (this._internalClient.acceptLanguage !== undefined && this._internalClient.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this._internalClient.acceptLanguage; } - return callback(err, result, response); - }); -} - -function keyListResponseDeserializer(callback) { - return keyResponseDeserializer(function(err, result, response) { - if (err || !result || !result.value || !result.value.length) { - return callback(err, result, response); + if (options) { + for (var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } } - var keys = result.value; - for (var i = 0; i < keys.length; ++i) { - keys[i].attributes = KeyAttributes.fromJson(keys[i].attributes); - } - return callback(err, result, response); - }); -} + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.headers['Accept'] = 'application/pkcs10'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + result = responseBody; + } + + return callback(null, result, httpRequest, response); + }); +}; -function keyResponseDeserializer(callback) { - return function (err, response) { - if (err) { - return callback(err, null, response); - } - if (response.keyOpResponse) { - return callback(null, JSON.parse(response.keyOpResponse), response); - } - return callback(new Error('Unrecognized response'), null, response); - }; -} -function serializeSecretRequest(request) { - var result = { rawJsonRequest: JSON.stringify(request) }; - if (request.attributes) { - result = JSON.parse(result.rawJsonRequest); - result.attributes = request.attributes.toJson(); - result = { rawJsonRequest: JSON.stringify(result) }; - } - return result; -} -function secretBundleResponseDeserializer(callback) { - return secretResponseDeserializer(function(err, result, response) { - if (err || !result) { - return callback(err, result, response); - } - if (result.attributes) { - result.attributes = SecretAttributes.fromJson(result.attributes); - } - return callback(err, result, response); - }); -} - -function secretListResponseDeserializer(callback) { - return secretResponseDeserializer(function(err, result, response) { - if (err || !result || !result.value || !result.value.length) { - return callback(err, result, response); - } - var secrets = result.value; - for (var i = 0; i < secrets.length; ++i) { - secrets[i].attributes = SecretAttributes.fromJson(secrets[i].attributes); - } - return callback(err, result, response); - }); -} - -function secretResponseDeserializer(callback) { - return function (err, response) { - if (err) { - return callback(err, null, response); - - } - if (response.response) { - return callback(null, JSON.parse(response.response), response); - } - return callback(new Error('Unrecognized response'), null, response); - }; -} - -function dateToNumber(d) { - if (!d) { - return null; - } - // A Date can be converted to string in JSON-clone operations, so let's tolerate. - if (_.isString(d)) { - d = new Date(d); - } - return parseInt(d.getTime() / 1000); -} - -function numberToDate(n) { - if (!n) { - return null; - } - return new Date(n*1000); -} - -function jwkToJson(src) { - var dst = {}; - dst.kid = src.kid; - dst.kty = src.kty; - dst.key_ops = src.key_ops; - dst.k = bufferToBase64Url(src.k); - dst.n = bufferToBase64Url(src.n); - dst.e = bufferToBase64Url(src.e); - dst.d = bufferToBase64Url(src.d); - dst.p = bufferToBase64Url(src.p); - dst.q = bufferToBase64Url(src.q); - dst.dp = bufferToBase64Url(src.dp); - dst.dq = bufferToBase64Url(src.dq); - dst.qi = bufferToBase64Url(src.qi); - dst.key_hsm = bufferToBase64Url(src.key_hsm); - return dst; -} - -function jwkFromJson(src) { - var dst = new jwk.JsonWebKey(); - dst.kid = src.kid; - dst.kty = src.kty; - dst.key_ops = src.key_ops; - dst.k = base64UrlToBuffer(src.k); - dst.n = base64UrlToBuffer(src.n); - dst.e = base64UrlToBuffer(src.e); - dst.d = base64UrlToBuffer(src.d); - dst.p = base64UrlToBuffer(src.p); - dst.q = base64UrlToBuffer(src.q); - dst.dp = base64UrlToBuffer(src.dp); - dst.dq = base64UrlToBuffer(src.dq); - dst.qi = base64UrlToBuffer(src.qi); - dst.key_hsm = base64UrlToBuffer(src.key_hsm); - return dst; -} - -function bufferToBase64Url(buffer) { - if (!buffer) { - return null; - } - // Buffer to Base64. - var str = buffer.toString('base64'); - // Base64 to Base64Url. - return trimEnd(str, '=').replace(/\+/g, '-').replace(/\//g, '_'); -} - -function trimEnd(str, ch) { - var len = str.length; - while ((len - 1) >= 0 && str[len - 1] === ch) { - --len; - } - return str.substr(0, len); -} - -function base64UrlToBuffer(str) { - if (!str) { - return null; - } - // Base64Url to Base64. - str = str.replace(/\-/g, '+').replace(/\_/g, '/'); - // Base64 to Buffer. - return new Buffer(str, 'base64'); -} +module.exports.KeyVaultClient = KeyVaultClient; +module.exports.JsonWebKeyEncryptionAlgorithms = jwk.JsonWebKeyEncryptionAlgorithms; +module.exports.JsonWebKeySignatureAlgorithms = jwk.JsonWebKeySignatureAlgorithms; +module.exports.KeyVaultCredentials = kvcreds.KeyVaultCredentials; +module.exports.parseKeyIdentifier = objId.parseKeyIdentifier; +module.exports.createSecretIdentifier = objId.createSecretIdentifier; +module.exports.createKeyIdentifier = objId.createKeyIdentifier; +module.exports.parseSecretIdentifier = objId.parseSecretIdentifier; +module.exports.createCertificateIdentifier = objId.createCertificateIdentifier; +module.exports.parseCertificateIdentifier = objId.parseCertificateIdentifier; +module.exports.createCertificateOperationIdentifier = objId.createCertificateOperationIdentifier; +module.exports.parseCertificateOperationIdentifier = objId.parseCertificateOperationIdentifier; +module.exports.createIssuerIdentifier = objId.createIssuerIdentifier; +module.exports.parseIssuerIdentifier = objId.parseIssuerIdentifier; +module.exports.Models = models; \ No newline at end of file diff --git a/lib/services/keyVault/lib/keyVaultClient.d.ts b/lib/services/keyVault/lib/keyVaultClient.d.ts new file mode 100644 index 000000000..503ba5b17 --- /dev/null +++ b/lib/services/keyVault/lib/keyVaultClient.d.ts @@ -0,0 +1,1514 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import { ServiceClientOptions, RequestOptions, ServiceCallback, ServiceClientCredentials } from 'ms-rest'; +import * as models from "./models"; + +declare class KeyVaultClient { + /** + * @class + * Initializes a new instance of the KeyVaultClient class. + * @constructor + * + * @param {credentials} credentials - Credentials needed for the client to connect to Azure. + * + * @param {object} [options] - The parameter options + * + * @param {Array} [options.filters] - Filters to be added to the request pipeline + * + * @param {object} [options.requestOptions] - Options for the underlying request object + * {@link https://github.com/request/request#requestoptions-callback Options doc} + * + * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy + * + * @param {string} [options.apiVersion] - Client Api Version. + * + * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. + * + * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + */ + constructor(credentials: ServiceClientCredentials, options: ServiceClientOptions); + + credentials: ServiceClientCredentials; + + apiVersion: string; + + acceptLanguage: string; + + longRunningOperationRetryTimeout: number; + + generateClientRequestId: boolean; + + /** + * Creates a new, named, key in the specified vault. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} keyName The name of the key + * + * @param {string} kty The type of key to create. Valid key types, see + * JsonWebKeyType. Possible values include: 'EC', 'RSA', 'RSA-HSM', 'oct' + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.keySize] The key size in bytes. e.g. 1024 or 2048. + * + * @param {array} [options.keyOps] + * + * @param {object} [options.keyAttributes] + * + * @param {boolean} [options.keyAttributes.enabled] Determines whether the + * object is enabled + * + * @param {date} [options.keyAttributes.notBefore] Not before date in UTC + * + * @param {date} [options.keyAttributes.expires] Expiry date in UTC + * + * @param {object} [options.tags] Application-specific metadata in the form of + * key-value pairs + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + createKey(vaultBaseUrl: string, keyName: string, kty: string, options: { keySize? : number, keyOps? : string[], keyAttributes? : models.KeyAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createKey(vaultBaseUrl: string, keyName: string, kty: string, callback: ServiceCallback): void; + + /** + * Imports a key into the specified vault + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} keyName The name of the key + * + * @param {object} key The Json web key + * + * @param {string} [key.kid] Key Identifier + * + * @param {string} [key.kty] Key type, usually RSA. Possible values include: + * 'EC', 'RSA', 'RSA-HSM', 'oct' + * + * @param {array} [key.keyOps] + * + * @param {buffer} [key.n] RSA modulus + * + * @param {buffer} [key.e] RSA public exponent + * + * @param {buffer} [key.d] RSA private exponent + * + * @param {buffer} [key.dp] RSA Private Key Parameter + * + * @param {buffer} [key.dq] RSA Private Key Parameter + * + * @param {buffer} [key.qi] RSA Private Key Parameter + * + * @param {buffer} [key.p] RSA secret prime + * + * @param {buffer} [key.q] RSA secret prime, with p < q + * + * @param {buffer} [key.k] Symmetric key + * + * @param {buffer} [key.t] HSM Token, used with Bring Your Own Key + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.hsm] Whether to import as a hardware key (HSM) or + * software key + * + * @param {object} [options.keyAttributes] The key management attributes + * + * @param {boolean} [options.keyAttributes.enabled] Determines whether the + * object is enabled + * + * @param {date} [options.keyAttributes.notBefore] Not before date in UTC + * + * @param {date} [options.keyAttributes.expires] Expiry date in UTC + * + * @param {object} [options.tags] Application-specific metadata in the form of + * key-value pairs + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + importKey(vaultBaseUrl: string, keyName: string, key: models.JsonWebKey, options: { hsm? : boolean, keyAttributes? : models.KeyAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + importKey(vaultBaseUrl: string, keyName: string, key: models.JsonWebKey, callback: ServiceCallback): void; + + /** + * Deletes the specified key + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} keyName The name of the key + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + deleteKey(vaultBaseUrl: string, keyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteKey(vaultBaseUrl: string, keyName: string, callback: ServiceCallback): void; + + /** + * Updates the Key Attributes associated with the specified key + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} keyName The name of the key + * + * @param {string} keyVersion The version of the key + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.keyOps] Json web key operations. For more + * information on possible key operations, see JsonWebKeyOperation. + * + * @param {object} [options.keyAttributes] + * + * @param {boolean} [options.keyAttributes.enabled] Determines whether the + * object is enabled + * + * @param {date} [options.keyAttributes.notBefore] Not before date in UTC + * + * @param {date} [options.keyAttributes.expires] Expiry date in UTC + * + * @param {object} [options.tags] Application-specific metadata in the form of + * key-value pairs + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + updateKey(vaultBaseUrl: string, keyName: string, keyVersion: string, options: { keyOps? : string[], keyAttributes? : models.KeyAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + updateKey(vaultBaseUrl: string, keyName: string, keyVersion: string, callback: ServiceCallback): void; + + /** + * Retrieves the public portion of a key plus its attributes + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} keyName The name of the key + * + * @param {string} keyVersion The version of the key + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + getKey(vaultBaseUrl: string, keyName: string, keyVersion: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getKey(vaultBaseUrl: string, keyName: string, keyVersion: string, callback: ServiceCallback): void; + + /** + * List the versions of the specified key + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} keyName The name of the key + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + getKeyVersions(vaultBaseUrl: string, keyName: string, options: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getKeyVersions(vaultBaseUrl: string, keyName: string, callback: ServiceCallback): void; + + /** + * List keys in the specified vault + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + getKeys(vaultBaseUrl: string, options: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getKeys(vaultBaseUrl: string, callback: ServiceCallback): void; + + /** + * Requests that a backup of the specified key be downloaded to the client. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} keyName The name of the key + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + backupKey(vaultBaseUrl: string, keyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + backupKey(vaultBaseUrl: string, keyName: string, callback: ServiceCallback): void; + + /** + * Restores the backup key in to a vault + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {buffer} keyBundleBackup the backup blob associated with a key bundle + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + restoreKey(vaultBaseUrl: string, keyBundleBackup: Buffer, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + restoreKey(vaultBaseUrl: string, keyBundleBackup: Buffer, callback: ServiceCallback): void; + + /** + * Encrypts an arbitrary sequence of bytes using an encryption key that is + * stored in Azure Key Vault. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} keyName The name of the key + * + * @param {string} keyVersion The version of the key + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA1_5' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + encrypt(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: string, value: Buffer, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + encrypt(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: string, value: Buffer, callback: ServiceCallback): void; + + /** + * Decrypts a single block of encrypted data + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} keyName The name of the key + * + * @param {string} keyVersion The version of the key + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA1_5' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + decrypt(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: string, value: Buffer, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + decrypt(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: string, value: Buffer, callback: ServiceCallback): void; + + /** + * Creates a signature from a digest using the specified key in the vault + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} keyName The name of the key + * + * @param {string} keyVersion The version of the key + * + * @param {string} algorithm The signing/verification algorithm identifier. + * For more information on possible algorithm types, see + * JsonWebKeySignatureAlgorithm. Possible values include: 'RS256', 'RS384', + * 'RS512', 'RSNULL' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + sign(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: string, value: Buffer, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + sign(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: string, value: Buffer, callback: ServiceCallback): void; + + /** + * Verifies a signature using the specified key + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} keyName The name of the key + * + * @param {string} keyVersion The version of the key + * + * @param {string} algorithm The signing/verification algorithm. For more + * information on possible algorithm types, see JsonWebKeySignatureAlgorithm. + * Possible values include: 'RS256', 'RS384', 'RS512', 'RSNULL' + * + * @param {buffer} digest The digest used for signing + * + * @param {buffer} signature The signature to be verified + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + verify(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: string, digest: Buffer, signature: Buffer, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + verify(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: string, digest: Buffer, signature: Buffer, callback: ServiceCallback): void; + + /** + * Wraps a symmetric key using the specified key + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} keyName The name of the key + * + * @param {string} keyVersion The version of the key + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA1_5' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + wrapKey(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: string, value: Buffer, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + wrapKey(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: string, value: Buffer, callback: ServiceCallback): void; + + /** + * Unwraps a symmetric key using the specified key in the vault that has + * initially been used for wrapping the key. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} keyName The name of the key + * + * @param {string} keyVersion The version of the key + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA1_5' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + unwrapKey(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: string, value: Buffer, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + unwrapKey(vaultBaseUrl: string, keyName: string, keyVersion: string, algorithm: string, value: Buffer, callback: ServiceCallback): void; + + /** + * Sets a secret in the specified vault. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} secretName The name of the secret in the given vault + * + * @param {string} value The value of the secret + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.tags] Application-specific metadata in the form of + * key-value pairs + * + * @param {string} [options.contentType] Type of the secret value such as a + * password + * + * @param {object} [options.secretAttributes] The secret management attributes + * + * @param {boolean} [options.secretAttributes.enabled] Determines whether the + * object is enabled + * + * @param {date} [options.secretAttributes.notBefore] Not before date in UTC + * + * @param {date} [options.secretAttributes.expires] Expiry date in UTC + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + setSecret(vaultBaseUrl: string, secretName: string, value: string, options: { tags? : { [propertyName: string]: string }, contentType? : string, secretAttributes? : models.SecretAttributes, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + setSecret(vaultBaseUrl: string, secretName: string, value: string, callback: ServiceCallback): void; + + /** + * Deletes a secret from the specified vault. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} secretName The name of the secret in the given vault + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + deleteSecret(vaultBaseUrl: string, secretName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteSecret(vaultBaseUrl: string, secretName: string, callback: ServiceCallback): void; + + /** + * Updates the attributes associated with the specified secret + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} secretName The name of the secret in the given vault + * + * @param {string} secretVersion The version of the secret + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.contentType] Type of the secret value such as a + * password + * + * @param {object} [options.secretAttributes] The secret management attributes + * + * @param {boolean} [options.secretAttributes.enabled] Determines whether the + * object is enabled + * + * @param {date} [options.secretAttributes.notBefore] Not before date in UTC + * + * @param {date} [options.secretAttributes.expires] Expiry date in UTC + * + * @param {object} [options.tags] Application-specific metadata in the form of + * key-value pairs + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + updateSecret(vaultBaseUrl: string, secretName: string, secretVersion: string, options: { contentType? : string, secretAttributes? : models.SecretAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + updateSecret(vaultBaseUrl: string, secretName: string, secretVersion: string, callback: ServiceCallback): void; + + /** + * Gets a secret. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} secretName The name of the secret in the given vault + * + * @param {string} secretVersion The version of the secret + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + getSecret(vaultBaseUrl: string, secretName: string, secretVersion: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getSecret(vaultBaseUrl: string, secretName: string, secretVersion: string, callback: ServiceCallback): void; + + /** + * List secrets in the specified vault + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of secrets to return. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + getSecrets(vaultBaseUrl: string, options: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getSecrets(vaultBaseUrl: string, callback: ServiceCallback): void; + + /** + * List the versions of the specified secret + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} secretName The name of the secret in the given vault + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + getSecretVersions(vaultBaseUrl: string, secretName: string, options: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getSecretVersions(vaultBaseUrl: string, secretName: string, callback: ServiceCallback): void; + + /** + * List certificates in the specified vault + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + getCertificates(vaultBaseUrl: string, options: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getCertificates(vaultBaseUrl: string, callback: ServiceCallback): void; + + /** + * Deletes a certificate from the specified vault. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} certificateName The name of the certificate in the given + * vault + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + deleteCertificate(vaultBaseUrl: string, certificateName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteCertificate(vaultBaseUrl: string, certificateName: string, callback: ServiceCallback): void; + + /** + * Sets the certificate contacts for the specified vault. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {object} contacts The contacts for the vault certificates. + * + * @param {array} [contacts.contactList] The contact list for the vault + * certificates. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + setCertificateContacts(vaultBaseUrl: string, contacts: models.Contacts, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + setCertificateContacts(vaultBaseUrl: string, contacts: models.Contacts, callback: ServiceCallback): void; + + /** + * Gets the certificate contacts for the specified vault. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + getCertificateContacts(vaultBaseUrl: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getCertificateContacts(vaultBaseUrl: string, callback: ServiceCallback): void; + + /** + * Deletes the certificate contacts for the specified vault. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + deleteCertificateContacts(vaultBaseUrl: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteCertificateContacts(vaultBaseUrl: string, callback: ServiceCallback): void; + + /** + * List certificate issuers for the specified vault. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + getCertificateIssuers(vaultBaseUrl: string, options: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getCertificateIssuers(vaultBaseUrl: string, callback: ServiceCallback): void; + + /** + * Sets the specified certificate issuer. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} issuerName The name of the issuer. + * + * @param {object} issuer The issuer bundle. + * + * @param {string} [issuer.provider] The name of the issuer. + * + * @param {object} [issuer.credentials] The credentials to be used for the + * issuer. + * + * @param {string} [issuer.credentials.accountId] The user name/account + * name/account id. + * + * @param {string} [issuer.credentials.password] The password/secret/account + * key. + * + * @param {object} [issuer.organizationDetails] Details of the organization as + * provided to the issuer. + * + * @param {string} [issuer.organizationDetails.id] Id of the organization. + * + * @param {array} [issuer.organizationDetails.adminDetails] Details of the + * organization administrator. + * + * @param {object} [issuer.attributes] Attributes of the issuer object. + * + * @param {boolean} [issuer.attributes.enabled] Determines whether the issuer + * is enabled + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + setCertificateIssuer(vaultBaseUrl: string, issuerName: string, issuer: models.IssuerBundle, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + setCertificateIssuer(vaultBaseUrl: string, issuerName: string, issuer: models.IssuerBundle, callback: ServiceCallback): void; + + /** + * Updates the specified certificate issuer. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} issuerName The name of the issuer. + * + * @param {object} issuer The issuer bundle. + * + * @param {string} [issuer.provider] The name of the issuer. + * + * @param {object} [issuer.credentials] The credentials to be used for the + * issuer. + * + * @param {string} [issuer.credentials.accountId] The user name/account + * name/account id. + * + * @param {string} [issuer.credentials.password] The password/secret/account + * key. + * + * @param {object} [issuer.organizationDetails] Details of the organization as + * provided to the issuer. + * + * @param {string} [issuer.organizationDetails.id] Id of the organization. + * + * @param {array} [issuer.organizationDetails.adminDetails] Details of the + * organization administrator. + * + * @param {object} [issuer.attributes] Attributes of the issuer object. + * + * @param {boolean} [issuer.attributes.enabled] Determines whether the issuer + * is enabled + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + updateCertificateIssuer(vaultBaseUrl: string, issuerName: string, issuer: models.IssuerBundle, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + updateCertificateIssuer(vaultBaseUrl: string, issuerName: string, issuer: models.IssuerBundle, callback: ServiceCallback): void; + + /** + * Gets the specified certificate issuer. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} issuerName The name of the issuer. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + getCertificateIssuer(vaultBaseUrl: string, issuerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getCertificateIssuer(vaultBaseUrl: string, issuerName: string, callback: ServiceCallback): void; + + /** + * Deletes the specified certificate issuer. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} issuerName The name of the issuer. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + deleteCertificateIssuer(vaultBaseUrl: string, issuerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteCertificateIssuer(vaultBaseUrl: string, issuerName: string, callback: ServiceCallback): void; + + /** + * Creates a new certificate version. If this is the first version, the + * certificate resource is created. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} certificateName The name of the certificate + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.certificatePolicy] The management policy for the + * certificate + * + * @param {object} [options.certificatePolicy.keyProperties] Properties of the + * key backing a certificate. + * + * @param {boolean} [options.certificatePolicy.keyProperties.exportable] + * Indicates if the private key can be exported. + * + * @param {string} [options.certificatePolicy.keyProperties.keyType] The key + * type. + * + * @param {number} [options.certificatePolicy.keyProperties.keySize] The key + * size in bytes. e.g. 1024 or 2048. + * + * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] + * Indicates if the same key pair will be used on certificate renewal. + * + * @param {object} [options.certificatePolicy.secretProperties] Properties of + * the secret backing a certificate. + * + * @param {string} [options.certificatePolicy.secretProperties.contentType] + * The media type (MIME type). + * + * @param {object} [options.certificatePolicy.x509CertificateProperties] + * Properties of the X509 component of a certificate. + * + * @param {string} + * [options.certificatePolicy.x509CertificateProperties.subject] The subject + * name. Should be a valid X509 Distinguished Name. + * + * @param {array} [options.certificatePolicy.x509CertificateProperties.ekus] + * The enhaunced key usage. + * + * @param {object} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames] + * The subject alternative names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.keyUsage] List of key + * usages. + * + * @param {number} + * [options.certificatePolicy.x509CertificateProperties.validityInMonths] The + * subject alternate names. + * + * @param {array} [options.certificatePolicy.lifetimeActions] Actions that + * will be performed by Key Vault over the lifetime of a certificate. + * + * @param {object} [options.certificatePolicy.issuerReference] Reference to + * the issuer of the X509 component of a certificate. + * + * @param {string} [options.certificatePolicy.issuerReference.name] Name of + * the referenced issuer object. + * + * @param {object} [options.certificatePolicy.attributes] The certificate + * attributes. + * + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional) + * + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled + * + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC + * + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC + * + * @param {object} [options.tags] Application-specific metadata in the form of + * key-value pairs + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + createCertificate(vaultBaseUrl: string, certificateName: string, options: { certificatePolicy? : models.CertificatePolicy, certificateAttributes? : models.CertificateAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createCertificate(vaultBaseUrl: string, certificateName: string, callback: ServiceCallback): void; + + /** + * Imports a certificate into the specified vault + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} certificateName The name of the certificate + * + * @param {string} base64EncodedCertificate Base64 encoded representation of + * the certificate object to import. This certificate needs to contain the + * private key. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.password] If the private key in + * base64EncodedCertificate is encrypted, the password used for encryption + * + * @param {object} [options.certificatePolicy] The management policy for the + * certificate + * + * @param {object} [options.certificatePolicy.keyProperties] Properties of the + * key backing a certificate. + * + * @param {boolean} [options.certificatePolicy.keyProperties.exportable] + * Indicates if the private key can be exported. + * + * @param {string} [options.certificatePolicy.keyProperties.keyType] The key + * type. + * + * @param {number} [options.certificatePolicy.keyProperties.keySize] The key + * size in bytes. e.g. 1024 or 2048. + * + * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] + * Indicates if the same key pair will be used on certificate renewal. + * + * @param {object} [options.certificatePolicy.secretProperties] Properties of + * the secret backing a certificate. + * + * @param {string} [options.certificatePolicy.secretProperties.contentType] + * The media type (MIME type). + * + * @param {object} [options.certificatePolicy.x509CertificateProperties] + * Properties of the X509 component of a certificate. + * + * @param {string} + * [options.certificatePolicy.x509CertificateProperties.subject] The subject + * name. Should be a valid X509 Distinguished Name. + * + * @param {array} [options.certificatePolicy.x509CertificateProperties.ekus] + * The enhaunced key usage. + * + * @param {object} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames] + * The subject alternative names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.keyUsage] List of key + * usages. + * + * @param {number} + * [options.certificatePolicy.x509CertificateProperties.validityInMonths] The + * subject alternate names. + * + * @param {array} [options.certificatePolicy.lifetimeActions] Actions that + * will be performed by Key Vault over the lifetime of a certificate. + * + * @param {object} [options.certificatePolicy.issuerReference] Reference to + * the issuer of the X509 component of a certificate. + * + * @param {string} [options.certificatePolicy.issuerReference.name] Name of + * the referenced issuer object. + * + * @param {object} [options.certificatePolicy.attributes] The certificate + * attributes. + * + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional) + * + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled + * + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC + * + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC + * + * @param {object} [options.tags] Application-specific metadata in the form of + * key-value pairs + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + importCertificate(vaultBaseUrl: string, certificateName: string, base64EncodedCertificate: string, options: { password? : string, certificatePolicy? : models.CertificatePolicy, certificateAttributes? : models.CertificateAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + importCertificate(vaultBaseUrl: string, certificateName: string, base64EncodedCertificate: string, callback: ServiceCallback): void; + + /** + * List the versions of a certificate. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} certificateName The name of the certificate + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + getCertificateVersions(vaultBaseUrl: string, certificateName: string, options: { maxresults? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getCertificateVersions(vaultBaseUrl: string, certificateName: string, callback: ServiceCallback): void; + + /** + * Gets the policy for a certificate. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} certificateName The name of the certificate in the given + * vault. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + getCertificatePolicy(vaultBaseUrl: string, certificateName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getCertificatePolicy(vaultBaseUrl: string, certificateName: string, callback: ServiceCallback): void; + + /** + * Updates the policy for a certificate. Set appropriate members in the + * certificatePolicy that must be updated. Leave others as null. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} certificateName The name of the certificate in the given + * vault. + * + * @param {object} certificatePolicy The policy for the certificate. + * + * @param {object} [certificatePolicy.keyProperties] Properties of the key + * backing a certificate. + * + * @param {boolean} [certificatePolicy.keyProperties.exportable] Indicates if + * the private key can be exported. + * + * @param {string} [certificatePolicy.keyProperties.keyType] The key type. + * + * @param {number} [certificatePolicy.keyProperties.keySize] The key size in + * bytes. e.g. 1024 or 2048. + * + * @param {boolean} [certificatePolicy.keyProperties.reuseKey] Indicates if + * the same key pair will be used on certificate renewal. + * + * @param {object} [certificatePolicy.secretProperties] Properties of the + * secret backing a certificate. + * + * @param {string} [certificatePolicy.secretProperties.contentType] The media + * type (MIME type). + * + * @param {object} [certificatePolicy.x509CertificateProperties] Properties of + * the X509 component of a certificate. + * + * @param {string} [certificatePolicy.x509CertificateProperties.subject] The + * subject name. Should be a valid X509 Distinguished Name. + * + * @param {array} [certificatePolicy.x509CertificateProperties.ekus] The + * enhaunced key usage. + * + * @param {object} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames] The + * subject alternative names. + * + * @param {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @param {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * + * @param {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @param {array} [certificatePolicy.x509CertificateProperties.keyUsage] List + * of key usages. + * + * @param {number} + * [certificatePolicy.x509CertificateProperties.validityInMonths] The subject + * alternate names. + * + * @param {array} [certificatePolicy.lifetimeActions] Actions that will be + * performed by Key Vault over the lifetime of a certificate. + * + * @param {object} [certificatePolicy.issuerReference] Reference to the issuer + * of the X509 component of a certificate. + * + * @param {string} [certificatePolicy.issuerReference.name] Name of the + * referenced issuer object. + * + * @param {object} [certificatePolicy.attributes] The certificate attributes. + * + * @param {boolean} [certificatePolicy.attributes.enabled] Determines whether + * the object is enabled + * + * @param {date} [certificatePolicy.attributes.notBefore] Not before date in + * UTC + * + * @param {date} [certificatePolicy.attributes.expires] Expiry date in UTC + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + updateCertificatePolicy(vaultBaseUrl: string, certificateName: string, certificatePolicy: models.CertificatePolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + updateCertificatePolicy(vaultBaseUrl: string, certificateName: string, certificatePolicy: models.CertificatePolicy, callback: ServiceCallback): void; + + /** + * Updates the attributes associated with the specified certificate + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} certificateName The name of the certificate in the given + * vault + * + * @param {string} certificateVersion The version of the certificate + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional) + * + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled + * + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC + * + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC + * + * @param {object} [options.tags] Application-specific metadata in the form of + * key-value pairs + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + updateCertificate(vaultBaseUrl: string, certificateName: string, certificateVersion: string, options: { certificateAttributes? : models.CertificateAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + updateCertificate(vaultBaseUrl: string, certificateName: string, certificateVersion: string, callback: ServiceCallback): void; + + /** + * Gets a Certificate. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} certificateName The name of the certificate in the given + * vault + * + * @param {string} certificateVersion The version of the certificate + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + getCertificate(vaultBaseUrl: string, certificateName: string, certificateVersion: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getCertificate(vaultBaseUrl: string, certificateName: string, certificateVersion: string, callback: ServiceCallback): void; + + /** + * Updates a certificate operation. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} certificateName The name of the certificate + * + * @param {object} certificateOperation The certificate operation response. + * + * @param {object} [certificateOperation.issuerReference] Reference to the + * issuer of the X509 component of a certificate. + * + * @param {string} [certificateOperation.issuerReference.name] Name of the + * referenced issuer object. + * + * @param {buffer} [certificateOperation.csr] The Certificate Signing Request + * (CSR) that is being used in the certificate operation. + * + * @param {boolean} [certificateOperation.cancellationRequested] Indicates if + * cancellation was requested on the certificate operation. + * + * @param {string} [certificateOperation.status] Status of the certificate + * operation. + * + * @param {string} [certificateOperation.statusDetails] The status details of + * the certificate operation. + * + * @param {object} [certificateOperation.error] Error encountered, if any, + * during the certificate operation. + * + * @param {string} [certificateOperation.target] Location which contains the + * result of the certificate operation. + * + * @param {string} [certificateOperation.requestId] Identifier for the + * certificate operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + updateCertificateOperation(vaultBaseUrl: string, certificateName: string, certificateOperation: models.CertificateOperation, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + updateCertificateOperation(vaultBaseUrl: string, certificateName: string, certificateOperation: models.CertificateOperation, callback: ServiceCallback): void; + + /** + * Gets the certificate operation response. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} certificateName The name of the certificate + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + getCertificateOperation(vaultBaseUrl: string, certificateName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getCertificateOperation(vaultBaseUrl: string, certificateName: string, callback: ServiceCallback): void; + + /** + * Deletes the certificate operation. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} certificateName The name of the certificate + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + deleteCertificateOperation(vaultBaseUrl: string, certificateName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteCertificateOperation(vaultBaseUrl: string, certificateName: string, callback: ServiceCallback): void; + + /** + * Merges a certificate or a certificate chain with a key pair existing on the + * server. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} certificateName The name of the certificate + * + * @param {array} x509Certificates The certificate or the certificate chain to + * merge + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional) + * + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled + * + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC + * + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC + * + * @param {object} [options.tags] Application-specific metadata in the form of + * key-value pairs + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + mergeCertificate(vaultBaseUrl: string, certificateName: string, x509Certificates: Buffer[], options: { certificateAttributes? : models.CertificateAttributes, tags? : { [propertyName: string]: string }, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + mergeCertificate(vaultBaseUrl: string, certificateName: string, x509Certificates: Buffer[], callback: ServiceCallback): void; + + /** + * List the versions of the specified key + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + getKeyVersionsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getKeyVersionsNext(nextPageLink: string, callback: ServiceCallback): void; + + /** + * List keys in the specified vault + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + getKeysNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getKeysNext(nextPageLink: string, callback: ServiceCallback): void; + + /** + * List secrets in the specified vault + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + getSecretsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getSecretsNext(nextPageLink: string, callback: ServiceCallback): void; + + /** + * List the versions of the specified secret + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + getSecretVersionsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getSecretVersionsNext(nextPageLink: string, callback: ServiceCallback): void; + + /** + * List certificates in the specified vault + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + getCertificatesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getCertificatesNext(nextPageLink: string, callback: ServiceCallback): void; + + /** + * List certificate issuers for the specified vault. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + getCertificateIssuersNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getCertificateIssuersNext(nextPageLink: string, callback: ServiceCallback): void; + + /** + * List the versions of a certificate. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + getCertificateVersionsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getCertificateVersionsNext(nextPageLink: string, callback: ServiceCallback): void; +} + +export = KeyVaultClient; diff --git a/lib/services/keyVault/lib/keyVaultClient.js b/lib/services/keyVault/lib/keyVaultClient.js new file mode 100644 index 000000000..bd856acaf --- /dev/null +++ b/lib/services/keyVault/lib/keyVaultClient.js @@ -0,0 +1,8287 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +/* jshint latedef:false */ +/* jshint forin:false */ +/* jshint noempty:false */ + +'use strict'; + +var util = require('util'); +var msRest = require('ms-rest'); +var msRestAzure = require('ms-rest-azure'); +var ServiceClient = msRestAzure.AzureServiceClient; +var WebResource = msRest.WebResource; + +var models = require('./models'); + +/** + * @class + * Initializes a new instance of the KeyVaultClient class. + * @constructor + * + * @param {credentials} credentials - Credentials needed for the client to connect to Azure. + * + * @param {object} [options] - The parameter options + * + * @param {Array} [options.filters] - Filters to be added to the request pipeline + * + * @param {object} [options.requestOptions] - Options for the underlying request object + * {@link https://github.com/request/request#requestoptions-callback Options doc} + * + * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy + * + * @param {string} [options.apiVersion] - Client Api Version. + * + * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. + * + * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + */ +function KeyVaultClient(credentials, options) { + this.apiVersion = '2015-06-01'; + this.acceptLanguage = 'en-US'; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + if (credentials === null || credentials === undefined) { + throw new Error('\'credentials\' cannot be null.'); + } + + if (!options) options = {}; + + KeyVaultClient['super_'].call(this, credentials, options); + this.baseUri = '{vaultBaseUrl}'; + this.credentials = credentials; + + if(options.apiVersion !== null && options.apiVersion !== undefined) { + this.apiVersion = options.apiVersion; + } + if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + this.acceptLanguage = options.acceptLanguage; + } + if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; + } + if(options.generateClientRequestId !== null && options.generateClientRequestId !== undefined) { + this.generateClientRequestId = options.generateClientRequestId; + } + this.models = models; + msRest.addSerializationMixin(this); +} + +util.inherits(KeyVaultClient, ServiceClient); + +/** + * Creates a new, named, key in the specified vault. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} keyName The name of the key + * + * @param {string} kty The type of key to create. Valid key types, see + * JsonWebKeyType. Possible values include: 'EC', 'RSA', 'RSA-HSM', 'oct' + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.keySize] The key size in bytes. e.g. 1024 or 2048. + * + * @param {array} [options.keyOps] + * + * @param {object} [options.keyAttributes] + * + * @param {boolean} [options.keyAttributes.enabled] Determines whether the + * object is enabled + * + * @param {date} [options.keyAttributes.notBefore] Not before date in UTC + * + * @param {date} [options.keyAttributes.expires] Expiry date in UTC + * + * @param {object} [options.tags] Application-specific metadata in the form of + * key-value pairs + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link KeyBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.createKey = function (vaultBaseUrl, keyName, kty, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + var keySize = (options && options.keySize !== undefined) ? options.keySize : undefined; + var keyOps = (options && options.keyOps !== undefined) ? options.keyOps : undefined; + var keyAttributes = (options && options.keyAttributes !== undefined) ? options.keyAttributes : undefined; + var tags = (options && options.tags !== undefined) ? options.tags : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (keyName === null || keyName === undefined || typeof keyName.valueOf() !== 'string') { + throw new Error('keyName cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (kty === null || kty === undefined || typeof kty.valueOf() !== 'string') { + throw new Error('kty cannot be null or undefined and it must be of type string.'); + } + if (kty !== null && kty !== undefined) { + if (kty.length < 1) + { + throw new Error('"kty" should satisfy the constraint - "MinLength": 1'); + } + } + if (keySize !== null && keySize !== undefined && typeof keySize !== 'number') { + throw new Error('keySize must be of type number.'); + } + if (util.isArray(keyOps)) { + for (var i = 0; i < keyOps.length; i++) { + if (keyOps[i] !== null && keyOps[i] !== undefined && typeof keyOps[i].valueOf() !== 'string') { + throw new Error('keyOps[i] must be of type string.'); + } + } + } + if (tags && typeof tags === 'object') { + for(var valueElement in tags) { + if (tags[valueElement] !== null && tags[valueElement] !== undefined && typeof tags[valueElement].valueOf() !== 'string') { + throw new Error('tags[valueElement] must be of type string.'); + } + } + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + var parameters; + if ((kty !== null && kty !== undefined) || (keySize !== null && keySize !== undefined) || (keyOps !== null && keyOps !== undefined) || (keyAttributes !== null && keyAttributes !== undefined) || (tags !== null && tags !== undefined)) { + parameters = new client.models['KeyCreateParameters'](); + parameters.kty = kty; + parameters.keySize = keySize; + parameters.keyOps = keyOps; + parameters.keyAttributes = keyAttributes; + parameters.tags = tags; + } + + // Construct URL + var requestUrl = this.baseUri + + '//keys/{key-name}/create'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{key-name}', encodeURIComponent(keyName)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + var requestModelMapper = new client.models['KeyCreateParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['KeyBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Imports a key into the specified vault + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} keyName The name of the key + * + * @param {object} key The Json web key + * + * @param {string} [key.kid] Key Identifier + * + * @param {string} [key.kty] Key type, usually RSA. Possible values include: + * 'EC', 'RSA', 'RSA-HSM', 'oct' + * + * @param {array} [key.keyOps] + * + * @param {buffer} [key.n] RSA modulus + * + * @param {buffer} [key.e] RSA public exponent + * + * @param {buffer} [key.d] RSA private exponent + * + * @param {buffer} [key.dp] RSA Private Key Parameter + * + * @param {buffer} [key.dq] RSA Private Key Parameter + * + * @param {buffer} [key.qi] RSA Private Key Parameter + * + * @param {buffer} [key.p] RSA secret prime + * + * @param {buffer} [key.q] RSA secret prime, with p < q + * + * @param {buffer} [key.k] Symmetric key + * + * @param {buffer} [key.t] HSM Token, used with Bring Your Own Key + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.hsm] Whether to import as a hardware key (HSM) or + * software key + * + * @param {object} [options.keyAttributes] The key management attributes + * + * @param {boolean} [options.keyAttributes.enabled] Determines whether the + * object is enabled + * + * @param {date} [options.keyAttributes.notBefore] Not before date in UTC + * + * @param {date} [options.keyAttributes.expires] Expiry date in UTC + * + * @param {object} [options.tags] Application-specific metadata in the form of + * key-value pairs + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link KeyBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.importKey = function (vaultBaseUrl, keyName, key, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + var hsm = (options && options.hsm !== undefined) ? options.hsm : undefined; + var keyAttributes = (options && options.keyAttributes !== undefined) ? options.keyAttributes : undefined; + var tags = (options && options.tags !== undefined) ? options.tags : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (keyName === null || keyName === undefined || typeof keyName.valueOf() !== 'string') { + throw new Error('keyName cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (hsm !== null && hsm !== undefined && typeof hsm !== 'boolean') { + throw new Error('hsm must be of type boolean.'); + } + if (key === null || key === undefined) { + throw new Error('key cannot be null or undefined.'); + } + if (tags && typeof tags === 'object') { + for(var valueElement in tags) { + if (tags[valueElement] !== null && tags[valueElement] !== undefined && typeof tags[valueElement].valueOf() !== 'string') { + throw new Error('tags[valueElement] must be of type string.'); + } + } + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + var parameters; + if ((hsm !== null && hsm !== undefined) || (key !== null && key !== undefined) || (keyAttributes !== null && keyAttributes !== undefined) || (tags !== null && tags !== undefined)) { + parameters = new client.models['KeyImportParameters'](); + parameters.hsm = hsm; + parameters.key = key; + parameters.keyAttributes = keyAttributes; + parameters.tags = tags; + } + + // Construct URL + var requestUrl = this.baseUri + + '//keys/{key-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{key-name}', encodeURIComponent(keyName)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + var requestModelMapper = new client.models['KeyImportParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['KeyBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Deletes the specified key + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} keyName The name of the key + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link KeyBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.deleteKey = function (vaultBaseUrl, keyName, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (keyName === null || keyName === undefined || typeof keyName.valueOf() !== 'string') { + throw new Error('keyName cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = this.baseUri + + '//keys/{key-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{key-name}', encodeURIComponent(keyName)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['KeyBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Updates the Key Attributes associated with the specified key + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} keyName The name of the key + * + * @param {string} keyVersion The version of the key + * + * @param {object} [options] Optional Parameters. + * + * @param {array} [options.keyOps] Json web key operations. For more + * information on possible key operations, see JsonWebKeyOperation. + * + * @param {object} [options.keyAttributes] + * + * @param {boolean} [options.keyAttributes.enabled] Determines whether the + * object is enabled + * + * @param {date} [options.keyAttributes.notBefore] Not before date in UTC + * + * @param {date} [options.keyAttributes.expires] Expiry date in UTC + * + * @param {object} [options.tags] Application-specific metadata in the form of + * key-value pairs + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link KeyBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.updateKey = function (vaultBaseUrl, keyName, keyVersion, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + var keyOps = (options && options.keyOps !== undefined) ? options.keyOps : undefined; + var keyAttributes = (options && options.keyAttributes !== undefined) ? options.keyAttributes : undefined; + var tags = (options && options.tags !== undefined) ? options.tags : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (keyName === null || keyName === undefined || typeof keyName.valueOf() !== 'string') { + throw new Error('keyName cannot be null or undefined and it must be of type string.'); + } + if (keyVersion === null || keyVersion === undefined || typeof keyVersion.valueOf() !== 'string') { + throw new Error('keyVersion cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (util.isArray(keyOps)) { + for (var i = 0; i < keyOps.length; i++) { + if (keyOps[i] !== null && keyOps[i] !== undefined && typeof keyOps[i].valueOf() !== 'string') { + throw new Error('keyOps[i] must be of type string.'); + } + } + } + if (tags && typeof tags === 'object') { + for(var valueElement in tags) { + if (tags[valueElement] !== null && tags[valueElement] !== undefined && typeof tags[valueElement].valueOf() !== 'string') { + throw new Error('tags[valueElement] must be of type string.'); + } + } + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + var parameters; + if ((keyOps !== null && keyOps !== undefined) || (keyAttributes !== null && keyAttributes !== undefined) || (tags !== null && tags !== undefined)) { + parameters = new client.models['KeyUpdateParameters'](); + parameters.keyOps = keyOps; + parameters.keyAttributes = keyAttributes; + parameters.tags = tags; + } + + // Construct URL + var requestUrl = this.baseUri + + '//keys/{key-name}/{key-version}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{key-name}', encodeURIComponent(keyName)); + requestUrl = requestUrl.replace('{key-version}', encodeURIComponent(keyVersion)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + var requestModelMapper = new client.models['KeyUpdateParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['KeyBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Retrieves the public portion of a key plus its attributes + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} keyName The name of the key + * + * @param {string} keyVersion The version of the key + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link KeyBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getKey = function (vaultBaseUrl, keyName, keyVersion, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (keyName === null || keyName === undefined || typeof keyName.valueOf() !== 'string') { + throw new Error('keyName cannot be null or undefined and it must be of type string.'); + } + if (keyVersion === null || keyVersion === undefined || typeof keyVersion.valueOf() !== 'string') { + throw new Error('keyVersion cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = this.baseUri + + '//keys/{key-name}/{key-version}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{key-name}', encodeURIComponent(keyName)); + requestUrl = requestUrl.replace('{key-version}', encodeURIComponent(keyVersion)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['KeyBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * List the versions of the specified key + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} keyName The name of the key + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link KeyListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getKeyVersions = function (vaultBaseUrl, keyName, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + var maxresults = (options && options.maxresults !== undefined) ? options.maxresults : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (keyName === null || keyName === undefined || typeof keyName.valueOf() !== 'string') { + throw new Error('keyName cannot be null or undefined and it must be of type string.'); + } + if (maxresults !== null && maxresults !== undefined && typeof maxresults !== 'number') { + throw new Error('maxresults must be of type number.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = this.baseUri + + '//keys/{key-name}/versions'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{key-name}', encodeURIComponent(keyName)); + var queryParameters = []; + if (maxresults !== null && maxresults !== undefined) { + queryParameters.push('maxresults=' + encodeURIComponent(maxresults.toString())); + } + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['KeyListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * List keys in the specified vault + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link KeyListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getKeys = function (vaultBaseUrl, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + var maxresults = (options && options.maxresults !== undefined) ? options.maxresults : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (maxresults !== null && maxresults !== undefined && typeof maxresults !== 'number') { + throw new Error('maxresults must be of type number.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = this.baseUri + + '//keys'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + var queryParameters = []; + if (maxresults !== null && maxresults !== undefined) { + queryParameters.push('maxresults=' + encodeURIComponent(maxresults.toString())); + } + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['KeyListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Requests that a backup of the specified key be downloaded to the client. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} keyName The name of the key + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link BackupKeyResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.backupKey = function (vaultBaseUrl, keyName, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (keyName === null || keyName === undefined || typeof keyName.valueOf() !== 'string') { + throw new Error('keyName cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = this.baseUri + + '//keys/{key-name}/backup'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{key-name}', encodeURIComponent(keyName)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['BackupKeyResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Restores the backup key in to a vault + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {buffer} keyBundleBackup the backup blob associated with a key bundle + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link KeyBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.restoreKey = function (vaultBaseUrl, keyBundleBackup, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (!Buffer.isBuffer(keyBundleBackup)) { + throw new Error('keyBundleBackup cannot be null or undefined and it must be of type buffer.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + var parameters; + if (keyBundleBackup !== null && keyBundleBackup !== undefined) { + parameters = new client.models['KeyRestoreParameters'](); + parameters.keyBundleBackup = keyBundleBackup; + } + + // Construct URL + var requestUrl = this.baseUri + + '//keys/restore'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + var requestModelMapper = new client.models['KeyRestoreParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['KeyBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Encrypts an arbitrary sequence of bytes using an encryption key that is + * stored in Azure Key Vault. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} keyName The name of the key + * + * @param {string} keyVersion The version of the key + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA1_5' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link KeyOperationResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.encrypt = function (vaultBaseUrl, keyName, keyVersion, algorithm, value, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (keyName === null || keyName === undefined || typeof keyName.valueOf() !== 'string') { + throw new Error('keyName cannot be null or undefined and it must be of type string.'); + } + if (keyVersion === null || keyVersion === undefined || typeof keyVersion.valueOf() !== 'string') { + throw new Error('keyVersion cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (algorithm === null || algorithm === undefined || typeof algorithm.valueOf() !== 'string') { + throw new Error('algorithm cannot be null or undefined and it must be of type string.'); + } + if (algorithm !== null && algorithm !== undefined) { + if (algorithm.length < 1) + { + throw new Error('"algorithm" should satisfy the constraint - "MinLength": 1'); + } + } + if (!Buffer.isBuffer(value)) { + throw new Error('value cannot be null or undefined and it must be of type buffer.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + var parameters; + if ((algorithm !== null && algorithm !== undefined) || (value !== null && value !== undefined)) { + parameters = new client.models['KeyOperationsParameters'](); + parameters.algorithm = algorithm; + parameters.value = value; + } + + // Construct URL + var requestUrl = this.baseUri + + '//keys/{key-name}/{key-version}/encrypt'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{key-name}', encodeURIComponent(keyName)); + requestUrl = requestUrl.replace('{key-version}', encodeURIComponent(keyVersion)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + var requestModelMapper = new client.models['KeyOperationsParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['KeyOperationResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Decrypts a single block of encrypted data + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} keyName The name of the key + * + * @param {string} keyVersion The version of the key + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA1_5' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link KeyOperationResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.decrypt = function (vaultBaseUrl, keyName, keyVersion, algorithm, value, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (keyName === null || keyName === undefined || typeof keyName.valueOf() !== 'string') { + throw new Error('keyName cannot be null or undefined and it must be of type string.'); + } + if (keyVersion === null || keyVersion === undefined || typeof keyVersion.valueOf() !== 'string') { + throw new Error('keyVersion cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (algorithm === null || algorithm === undefined || typeof algorithm.valueOf() !== 'string') { + throw new Error('algorithm cannot be null or undefined and it must be of type string.'); + } + if (algorithm !== null && algorithm !== undefined) { + if (algorithm.length < 1) + { + throw new Error('"algorithm" should satisfy the constraint - "MinLength": 1'); + } + } + if (!Buffer.isBuffer(value)) { + throw new Error('value cannot be null or undefined and it must be of type buffer.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + var parameters; + if ((algorithm !== null && algorithm !== undefined) || (value !== null && value !== undefined)) { + parameters = new client.models['KeyOperationsParameters'](); + parameters.algorithm = algorithm; + parameters.value = value; + } + + // Construct URL + var requestUrl = this.baseUri + + '//keys/{key-name}/{key-version}/decrypt'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{key-name}', encodeURIComponent(keyName)); + requestUrl = requestUrl.replace('{key-version}', encodeURIComponent(keyVersion)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + var requestModelMapper = new client.models['KeyOperationsParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['KeyOperationResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Creates a signature from a digest using the specified key in the vault + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} keyName The name of the key + * + * @param {string} keyVersion The version of the key + * + * @param {string} algorithm The signing/verification algorithm identifier. + * For more information on possible algorithm types, see + * JsonWebKeySignatureAlgorithm. Possible values include: 'RS256', 'RS384', + * 'RS512', 'RSNULL' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link KeyOperationResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.sign = function (vaultBaseUrl, keyName, keyVersion, algorithm, value, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (keyName === null || keyName === undefined || typeof keyName.valueOf() !== 'string') { + throw new Error('keyName cannot be null or undefined and it must be of type string.'); + } + if (keyVersion === null || keyVersion === undefined || typeof keyVersion.valueOf() !== 'string') { + throw new Error('keyVersion cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (algorithm === null || algorithm === undefined || typeof algorithm.valueOf() !== 'string') { + throw new Error('algorithm cannot be null or undefined and it must be of type string.'); + } + if (algorithm !== null && algorithm !== undefined) { + if (algorithm.length < 1) + { + throw new Error('"algorithm" should satisfy the constraint - "MinLength": 1'); + } + } + if (!Buffer.isBuffer(value)) { + throw new Error('value cannot be null or undefined and it must be of type buffer.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + var parameters; + if ((algorithm !== null && algorithm !== undefined) || (value !== null && value !== undefined)) { + parameters = new client.models['KeySignParameters'](); + parameters.algorithm = algorithm; + parameters.value = value; + } + + // Construct URL + var requestUrl = this.baseUri + + '//keys/{key-name}/{key-version}/sign'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{key-name}', encodeURIComponent(keyName)); + requestUrl = requestUrl.replace('{key-version}', encodeURIComponent(keyVersion)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + var requestModelMapper = new client.models['KeySignParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['KeyOperationResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Verifies a signature using the specified key + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} keyName The name of the key + * + * @param {string} keyVersion The version of the key + * + * @param {string} algorithm The signing/verification algorithm. For more + * information on possible algorithm types, see JsonWebKeySignatureAlgorithm. + * Possible values include: 'RS256', 'RS384', 'RS512', 'RSNULL' + * + * @param {buffer} digest The digest used for signing + * + * @param {buffer} signature The signature to be verified + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link KeyVerifyResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.verify = function (vaultBaseUrl, keyName, keyVersion, algorithm, digest, signature, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (keyName === null || keyName === undefined || typeof keyName.valueOf() !== 'string') { + throw new Error('keyName cannot be null or undefined and it must be of type string.'); + } + if (keyVersion === null || keyVersion === undefined || typeof keyVersion.valueOf() !== 'string') { + throw new Error('keyVersion cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (algorithm === null || algorithm === undefined || typeof algorithm.valueOf() !== 'string') { + throw new Error('algorithm cannot be null or undefined and it must be of type string.'); + } + if (algorithm !== null && algorithm !== undefined) { + if (algorithm.length < 1) + { + throw new Error('"algorithm" should satisfy the constraint - "MinLength": 1'); + } + } + if (!Buffer.isBuffer(digest)) { + throw new Error('digest cannot be null or undefined and it must be of type buffer.'); + } + if (!Buffer.isBuffer(signature)) { + throw new Error('signature cannot be null or undefined and it must be of type buffer.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + var parameters; + if ((algorithm !== null && algorithm !== undefined) || (digest !== null && digest !== undefined) || (signature !== null && signature !== undefined)) { + parameters = new client.models['KeyVerifyParameters'](); + parameters.algorithm = algorithm; + parameters.digest = digest; + parameters.signature = signature; + } + + // Construct URL + var requestUrl = this.baseUri + + '//keys/{key-name}/{key-version}/verify'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{key-name}', encodeURIComponent(keyName)); + requestUrl = requestUrl.replace('{key-version}', encodeURIComponent(keyVersion)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + var requestModelMapper = new client.models['KeyVerifyParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['KeyVerifyResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Wraps a symmetric key using the specified key + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} keyName The name of the key + * + * @param {string} keyVersion The version of the key + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA1_5' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link KeyOperationResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.wrapKey = function (vaultBaseUrl, keyName, keyVersion, algorithm, value, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (keyName === null || keyName === undefined || typeof keyName.valueOf() !== 'string') { + throw new Error('keyName cannot be null or undefined and it must be of type string.'); + } + if (keyVersion === null || keyVersion === undefined || typeof keyVersion.valueOf() !== 'string') { + throw new Error('keyVersion cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (algorithm === null || algorithm === undefined || typeof algorithm.valueOf() !== 'string') { + throw new Error('algorithm cannot be null or undefined and it must be of type string.'); + } + if (algorithm !== null && algorithm !== undefined) { + if (algorithm.length < 1) + { + throw new Error('"algorithm" should satisfy the constraint - "MinLength": 1'); + } + } + if (!Buffer.isBuffer(value)) { + throw new Error('value cannot be null or undefined and it must be of type buffer.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + var parameters; + if ((algorithm !== null && algorithm !== undefined) || (value !== null && value !== undefined)) { + parameters = new client.models['KeyOperationsParameters'](); + parameters.algorithm = algorithm; + parameters.value = value; + } + + // Construct URL + var requestUrl = this.baseUri + + '//keys/{key-name}/{key-version}/wrapkey'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{key-name}', encodeURIComponent(keyName)); + requestUrl = requestUrl.replace('{key-version}', encodeURIComponent(keyVersion)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + var requestModelMapper = new client.models['KeyOperationsParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['KeyOperationResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Unwraps a symmetric key using the specified key in the vault that has + * initially been used for wrapping the key. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} keyName The name of the key + * + * @param {string} keyVersion The version of the key + * + * @param {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA1_5' + * + * @param {buffer} value + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link KeyOperationResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.unwrapKey = function (vaultBaseUrl, keyName, keyVersion, algorithm, value, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (keyName === null || keyName === undefined || typeof keyName.valueOf() !== 'string') { + throw new Error('keyName cannot be null or undefined and it must be of type string.'); + } + if (keyVersion === null || keyVersion === undefined || typeof keyVersion.valueOf() !== 'string') { + throw new Error('keyVersion cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (algorithm === null || algorithm === undefined || typeof algorithm.valueOf() !== 'string') { + throw new Error('algorithm cannot be null or undefined and it must be of type string.'); + } + if (algorithm !== null && algorithm !== undefined) { + if (algorithm.length < 1) + { + throw new Error('"algorithm" should satisfy the constraint - "MinLength": 1'); + } + } + if (!Buffer.isBuffer(value)) { + throw new Error('value cannot be null or undefined and it must be of type buffer.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + var parameters; + if ((algorithm !== null && algorithm !== undefined) || (value !== null && value !== undefined)) { + parameters = new client.models['KeyOperationsParameters'](); + parameters.algorithm = algorithm; + parameters.value = value; + } + + // Construct URL + var requestUrl = this.baseUri + + '//keys/{key-name}/{key-version}/unwrapkey'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{key-name}', encodeURIComponent(keyName)); + requestUrl = requestUrl.replace('{key-version}', encodeURIComponent(keyVersion)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + var requestModelMapper = new client.models['KeyOperationsParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['KeyOperationResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Sets a secret in the specified vault. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} secretName The name of the secret in the given vault + * + * @param {string} value The value of the secret + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.tags] Application-specific metadata in the form of + * key-value pairs + * + * @param {string} [options.contentType] Type of the secret value such as a + * password + * + * @param {object} [options.secretAttributes] The secret management attributes + * + * @param {boolean} [options.secretAttributes.enabled] Determines whether the + * object is enabled + * + * @param {date} [options.secretAttributes.notBefore] Not before date in UTC + * + * @param {date} [options.secretAttributes.expires] Expiry date in UTC + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link SecretBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.setSecret = function (vaultBaseUrl, secretName, value, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + var tags = (options && options.tags !== undefined) ? options.tags : undefined; + var contentType = (options && options.contentType !== undefined) ? options.contentType : undefined; + var secretAttributes = (options && options.secretAttributes !== undefined) ? options.secretAttributes : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (secretName === null || secretName === undefined || typeof secretName.valueOf() !== 'string') { + throw new Error('secretName cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (value === null || value === undefined || typeof value.valueOf() !== 'string') { + throw new Error('value cannot be null or undefined and it must be of type string.'); + } + if (tags && typeof tags === 'object') { + for(var valueElement in tags) { + if (tags[valueElement] !== null && tags[valueElement] !== undefined && typeof tags[valueElement].valueOf() !== 'string') { + throw new Error('tags[valueElement] must be of type string.'); + } + } + } + if (contentType !== null && contentType !== undefined && typeof contentType.valueOf() !== 'string') { + throw new Error('contentType must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + var parameters; + if ((value !== null && value !== undefined) || (tags !== null && tags !== undefined) || (contentType !== null && contentType !== undefined) || (secretAttributes !== null && secretAttributes !== undefined)) { + parameters = new client.models['SecretSetParameters'](); + parameters.value = value; + parameters.tags = tags; + parameters.contentType = contentType; + parameters.secretAttributes = secretAttributes; + } + + // Construct URL + var requestUrl = this.baseUri + + '//secrets/{secret-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{secret-name}', encodeURIComponent(secretName)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + var requestModelMapper = new client.models['SecretSetParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['SecretBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Deletes a secret from the specified vault. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} secretName The name of the secret in the given vault + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link SecretBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.deleteSecret = function (vaultBaseUrl, secretName, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (secretName === null || secretName === undefined || typeof secretName.valueOf() !== 'string') { + throw new Error('secretName cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = this.baseUri + + '//secrets/{secret-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{secret-name}', encodeURIComponent(secretName)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['SecretBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Updates the attributes associated with the specified secret + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} secretName The name of the secret in the given vault + * + * @param {string} secretVersion The version of the secret + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.contentType] Type of the secret value such as a + * password + * + * @param {object} [options.secretAttributes] The secret management attributes + * + * @param {boolean} [options.secretAttributes.enabled] Determines whether the + * object is enabled + * + * @param {date} [options.secretAttributes.notBefore] Not before date in UTC + * + * @param {date} [options.secretAttributes.expires] Expiry date in UTC + * + * @param {object} [options.tags] Application-specific metadata in the form of + * key-value pairs + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link SecretBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.updateSecret = function (vaultBaseUrl, secretName, secretVersion, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + var contentType = (options && options.contentType !== undefined) ? options.contentType : undefined; + var secretAttributes = (options && options.secretAttributes !== undefined) ? options.secretAttributes : undefined; + var tags = (options && options.tags !== undefined) ? options.tags : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (secretName === null || secretName === undefined || typeof secretName.valueOf() !== 'string') { + throw new Error('secretName cannot be null or undefined and it must be of type string.'); + } + if (secretVersion === null || secretVersion === undefined || typeof secretVersion.valueOf() !== 'string') { + throw new Error('secretVersion cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (contentType !== null && contentType !== undefined && typeof contentType.valueOf() !== 'string') { + throw new Error('contentType must be of type string.'); + } + if (tags && typeof tags === 'object') { + for(var valueElement in tags) { + if (tags[valueElement] !== null && tags[valueElement] !== undefined && typeof tags[valueElement].valueOf() !== 'string') { + throw new Error('tags[valueElement] must be of type string.'); + } + } + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + var parameters; + if ((contentType !== null && contentType !== undefined) || (secretAttributes !== null && secretAttributes !== undefined) || (tags !== null && tags !== undefined)) { + parameters = new client.models['SecretUpdateParameters'](); + parameters.contentType = contentType; + parameters.secretAttributes = secretAttributes; + parameters.tags = tags; + } + + // Construct URL + var requestUrl = this.baseUri + + '//secrets/{secret-name}/{secret-version}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{secret-name}', encodeURIComponent(secretName)); + requestUrl = requestUrl.replace('{secret-version}', encodeURIComponent(secretVersion)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + var requestModelMapper = new client.models['SecretUpdateParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['SecretBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Gets a secret. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} secretName The name of the secret in the given vault + * + * @param {string} secretVersion The version of the secret + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link SecretBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getSecret = function (vaultBaseUrl, secretName, secretVersion, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (secretName === null || secretName === undefined || typeof secretName.valueOf() !== 'string') { + throw new Error('secretName cannot be null or undefined and it must be of type string.'); + } + if (secretVersion === null || secretVersion === undefined || typeof secretVersion.valueOf() !== 'string') { + throw new Error('secretVersion cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = this.baseUri + + '//secrets/{secret-name}/{secret-version}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{secret-name}', encodeURIComponent(secretName)); + requestUrl = requestUrl.replace('{secret-version}', encodeURIComponent(secretVersion)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['SecretBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * List secrets in the specified vault + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of secrets to return. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link SecretListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getSecrets = function (vaultBaseUrl, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + var maxresults = (options && options.maxresults !== undefined) ? options.maxresults : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (maxresults !== null && maxresults !== undefined && typeof maxresults !== 'number') { + throw new Error('maxresults must be of type number.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = this.baseUri + + '//secrets'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + var queryParameters = []; + if (maxresults !== null && maxresults !== undefined) { + queryParameters.push('maxresults=' + encodeURIComponent(maxresults.toString())); + } + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['SecretListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * List the versions of the specified secret + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} secretName The name of the secret in the given vault + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link SecretListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getSecretVersions = function (vaultBaseUrl, secretName, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + var maxresults = (options && options.maxresults !== undefined) ? options.maxresults : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (secretName === null || secretName === undefined || typeof secretName.valueOf() !== 'string') { + throw new Error('secretName cannot be null or undefined and it must be of type string.'); + } + if (maxresults !== null && maxresults !== undefined && typeof maxresults !== 'number') { + throw new Error('maxresults must be of type number.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = this.baseUri + + '//secrets/{secret-name}/versions'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{secret-name}', encodeURIComponent(secretName)); + var queryParameters = []; + if (maxresults !== null && maxresults !== undefined) { + queryParameters.push('maxresults=' + encodeURIComponent(maxresults.toString())); + } + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['SecretListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * List certificates in the specified vault + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link CertificateListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getCertificates = function (vaultBaseUrl, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + var maxresults = (options && options.maxresults !== undefined) ? options.maxresults : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (maxresults !== null && maxresults !== undefined && typeof maxresults !== 'number') { + throw new Error('maxresults must be of type number.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = this.baseUri + + '//certificates'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + var queryParameters = []; + if (maxresults !== null && maxresults !== undefined) { + queryParameters.push('maxresults=' + encodeURIComponent(maxresults.toString())); + } + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['CertificateListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Deletes a certificate from the specified vault. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} certificateName The name of the certificate in the given + * vault + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link CertificateBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.deleteCertificate = function (vaultBaseUrl, certificateName, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (certificateName === null || certificateName === undefined || typeof certificateName.valueOf() !== 'string') { + throw new Error('certificateName cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = this.baseUri + + '//certificates/{certificate-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{certificate-name}', encodeURIComponent(certificateName)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['CertificateBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Sets the certificate contacts for the specified vault. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {object} contacts The contacts for the vault certificates. + * + * @param {array} [contacts.contactList] The contact list for the vault + * certificates. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link Contacts} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.setCertificateContacts = function (vaultBaseUrl, contacts, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (contacts === null || contacts === undefined) { + throw new Error('contacts cannot be null or undefined.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = this.baseUri + + '//certificates/contacts'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (contacts !== null && contacts !== undefined) { + var requestModelMapper = new client.models['Contacts']().mapper(); + requestModel = client.serialize(requestModelMapper, contacts, 'contacts'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + 'payload - "%s"', error.message, util.inspect(contacts, {depth: null}))); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['Contacts']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Gets the certificate contacts for the specified vault. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link Contacts} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getCertificateContacts = function (vaultBaseUrl, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = this.baseUri + + '//certificates/contacts'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['Contacts']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Deletes the certificate contacts for the specified vault. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link Contacts} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.deleteCertificateContacts = function (vaultBaseUrl, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = this.baseUri + + '//certificates/contacts'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['Contacts']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * List certificate issuers for the specified vault. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link CertificateIssuerListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getCertificateIssuers = function (vaultBaseUrl, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + var maxresults = (options && options.maxresults !== undefined) ? options.maxresults : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (maxresults !== null && maxresults !== undefined && typeof maxresults !== 'number') { + throw new Error('maxresults must be of type number.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = this.baseUri + + '//certificates/issuers'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + var queryParameters = []; + if (maxresults !== null && maxresults !== undefined) { + queryParameters.push('maxresults=' + encodeURIComponent(maxresults.toString())); + } + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['CertificateIssuerListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Sets the specified certificate issuer. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} issuerName The name of the issuer. + * + * @param {object} issuer The issuer bundle. + * + * @param {string} [issuer.provider] The name of the issuer. + * + * @param {object} [issuer.credentials] The credentials to be used for the + * issuer. + * + * @param {string} [issuer.credentials.accountId] The user name/account + * name/account id. + * + * @param {string} [issuer.credentials.password] The password/secret/account + * key. + * + * @param {object} [issuer.organizationDetails] Details of the organization as + * provided to the issuer. + * + * @param {string} [issuer.organizationDetails.id] Id of the organization. + * + * @param {array} [issuer.organizationDetails.adminDetails] Details of the + * organization administrator. + * + * @param {object} [issuer.attributes] Attributes of the issuer object. + * + * @param {boolean} [issuer.attributes.enabled] Determines whether the issuer + * is enabled + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link IssuerBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.setCertificateIssuer = function (vaultBaseUrl, issuerName, issuer, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (issuerName === null || issuerName === undefined || typeof issuerName.valueOf() !== 'string') { + throw new Error('issuerName cannot be null or undefined and it must be of type string.'); + } + if (issuer === null || issuer === undefined) { + throw new Error('issuer cannot be null or undefined.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = this.baseUri + + '//certificates/issuers/{issuer-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{issuer-name}', encodeURIComponent(issuerName)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (issuer !== null && issuer !== undefined) { + var requestModelMapper = new client.models['IssuerBundle']().mapper(); + requestModel = client.serialize(requestModelMapper, issuer, 'issuer'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + 'payload - "%s"', error.message, util.inspect(issuer, {depth: null}))); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['IssuerBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Updates the specified certificate issuer. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} issuerName The name of the issuer. + * + * @param {object} issuer The issuer bundle. + * + * @param {string} [issuer.provider] The name of the issuer. + * + * @param {object} [issuer.credentials] The credentials to be used for the + * issuer. + * + * @param {string} [issuer.credentials.accountId] The user name/account + * name/account id. + * + * @param {string} [issuer.credentials.password] The password/secret/account + * key. + * + * @param {object} [issuer.organizationDetails] Details of the organization as + * provided to the issuer. + * + * @param {string} [issuer.organizationDetails.id] Id of the organization. + * + * @param {array} [issuer.organizationDetails.adminDetails] Details of the + * organization administrator. + * + * @param {object} [issuer.attributes] Attributes of the issuer object. + * + * @param {boolean} [issuer.attributes.enabled] Determines whether the issuer + * is enabled + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link IssuerBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.updateCertificateIssuer = function (vaultBaseUrl, issuerName, issuer, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (issuerName === null || issuerName === undefined || typeof issuerName.valueOf() !== 'string') { + throw new Error('issuerName cannot be null or undefined and it must be of type string.'); + } + if (issuer === null || issuer === undefined) { + throw new Error('issuer cannot be null or undefined.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = this.baseUri + + '//certificates/issuers/{issuer-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{issuer-name}', encodeURIComponent(issuerName)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (issuer !== null && issuer !== undefined) { + var requestModelMapper = new client.models['IssuerBundle']().mapper(); + requestModel = client.serialize(requestModelMapper, issuer, 'issuer'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + 'payload - "%s"', error.message, util.inspect(issuer, {depth: null}))); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['IssuerBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Gets the specified certificate issuer. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} issuerName The name of the issuer. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link IssuerBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getCertificateIssuer = function (vaultBaseUrl, issuerName, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (issuerName === null || issuerName === undefined || typeof issuerName.valueOf() !== 'string') { + throw new Error('issuerName cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = this.baseUri + + '//certificates/issuers/{issuer-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{issuer-name}', encodeURIComponent(issuerName)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['IssuerBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Deletes the specified certificate issuer. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} issuerName The name of the issuer. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link IssuerBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.deleteCertificateIssuer = function (vaultBaseUrl, issuerName, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (issuerName === null || issuerName === undefined || typeof issuerName.valueOf() !== 'string') { + throw new Error('issuerName cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = this.baseUri + + '//certificates/issuers/{issuer-name}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{issuer-name}', encodeURIComponent(issuerName)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['IssuerBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Creates a new certificate version. If this is the first version, the + * certificate resource is created. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} certificateName The name of the certificate + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.certificatePolicy] The management policy for the + * certificate + * + * @param {object} [options.certificatePolicy.keyProperties] Properties of the + * key backing a certificate. + * + * @param {boolean} [options.certificatePolicy.keyProperties.exportable] + * Indicates if the private key can be exported. + * + * @param {string} [options.certificatePolicy.keyProperties.keyType] The key + * type. + * + * @param {number} [options.certificatePolicy.keyProperties.keySize] The key + * size in bytes. e.g. 1024 or 2048. + * + * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] + * Indicates if the same key pair will be used on certificate renewal. + * + * @param {object} [options.certificatePolicy.secretProperties] Properties of + * the secret backing a certificate. + * + * @param {string} [options.certificatePolicy.secretProperties.contentType] + * The media type (MIME type). + * + * @param {object} [options.certificatePolicy.x509CertificateProperties] + * Properties of the X509 component of a certificate. + * + * @param {string} + * [options.certificatePolicy.x509CertificateProperties.subject] The subject + * name. Should be a valid X509 Distinguished Name. + * + * @param {array} [options.certificatePolicy.x509CertificateProperties.ekus] + * The enhaunced key usage. + * + * @param {object} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames] + * The subject alternative names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.keyUsage] List of key + * usages. + * + * @param {number} + * [options.certificatePolicy.x509CertificateProperties.validityInMonths] The + * subject alternate names. + * + * @param {array} [options.certificatePolicy.lifetimeActions] Actions that + * will be performed by Key Vault over the lifetime of a certificate. + * + * @param {object} [options.certificatePolicy.issuerReference] Reference to + * the issuer of the X509 component of a certificate. + * + * @param {string} [options.certificatePolicy.issuerReference.name] Name of + * the referenced issuer object. + * + * @param {object} [options.certificatePolicy.attributes] The certificate + * attributes. + * + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional) + * + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled + * + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC + * + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC + * + * @param {object} [options.tags] Application-specific metadata in the form of + * key-value pairs + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link CertificateOperation} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.createCertificate = function (vaultBaseUrl, certificateName, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + var certificatePolicy = (options && options.certificatePolicy !== undefined) ? options.certificatePolicy : undefined; + var certificateAttributes = (options && options.certificateAttributes !== undefined) ? options.certificateAttributes : undefined; + var tags = (options && options.tags !== undefined) ? options.tags : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (certificateName === null || certificateName === undefined || typeof certificateName.valueOf() !== 'string') { + throw new Error('certificateName cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (tags && typeof tags === 'object') { + for(var valueElement in tags) { + if (tags[valueElement] !== null && tags[valueElement] !== undefined && typeof tags[valueElement].valueOf() !== 'string') { + throw new Error('tags[valueElement] must be of type string.'); + } + } + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + var parameters; + if ((certificatePolicy !== null && certificatePolicy !== undefined) || (certificateAttributes !== null && certificateAttributes !== undefined) || (tags !== null && tags !== undefined)) { + parameters = new client.models['CertificateCreateParameters'](); + parameters.certificatePolicy = certificatePolicy; + parameters.certificateAttributes = certificateAttributes; + parameters.tags = tags; + } + + // Construct URL + var requestUrl = this.baseUri + + '//certificates/{certificate-name}/create'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{certificate-name}', encodeURIComponent(certificateName)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + var requestModelMapper = new client.models['CertificateCreateParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 202) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 202) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['CertificateOperation']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Imports a certificate into the specified vault + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} certificateName The name of the certificate + * + * @param {string} base64EncodedCertificate Base64 encoded representation of + * the certificate object to import. This certificate needs to contain the + * private key. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.password] If the private key in + * base64EncodedCertificate is encrypted, the password used for encryption + * + * @param {object} [options.certificatePolicy] The management policy for the + * certificate + * + * @param {object} [options.certificatePolicy.keyProperties] Properties of the + * key backing a certificate. + * + * @param {boolean} [options.certificatePolicy.keyProperties.exportable] + * Indicates if the private key can be exported. + * + * @param {string} [options.certificatePolicy.keyProperties.keyType] The key + * type. + * + * @param {number} [options.certificatePolicy.keyProperties.keySize] The key + * size in bytes. e.g. 1024 or 2048. + * + * @param {boolean} [options.certificatePolicy.keyProperties.reuseKey] + * Indicates if the same key pair will be used on certificate renewal. + * + * @param {object} [options.certificatePolicy.secretProperties] Properties of + * the secret backing a certificate. + * + * @param {string} [options.certificatePolicy.secretProperties.contentType] + * The media type (MIME type). + * + * @param {object} [options.certificatePolicy.x509CertificateProperties] + * Properties of the X509 component of a certificate. + * + * @param {string} + * [options.certificatePolicy.x509CertificateProperties.subject] The subject + * name. Should be a valid X509 Distinguished Name. + * + * @param {array} [options.certificatePolicy.x509CertificateProperties.ekus] + * The enhaunced key usage. + * + * @param {object} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames] + * The subject alternative names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @param {array} + * [options.certificatePolicy.x509CertificateProperties.keyUsage] List of key + * usages. + * + * @param {number} + * [options.certificatePolicy.x509CertificateProperties.validityInMonths] The + * subject alternate names. + * + * @param {array} [options.certificatePolicy.lifetimeActions] Actions that + * will be performed by Key Vault over the lifetime of a certificate. + * + * @param {object} [options.certificatePolicy.issuerReference] Reference to + * the issuer of the X509 component of a certificate. + * + * @param {string} [options.certificatePolicy.issuerReference.name] Name of + * the referenced issuer object. + * + * @param {object} [options.certificatePolicy.attributes] The certificate + * attributes. + * + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional) + * + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled + * + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC + * + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC + * + * @param {object} [options.tags] Application-specific metadata in the form of + * key-value pairs + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link CertificateBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.importCertificate = function (vaultBaseUrl, certificateName, base64EncodedCertificate, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + var password = (options && options.password !== undefined) ? options.password : undefined; + var certificatePolicy = (options && options.certificatePolicy !== undefined) ? options.certificatePolicy : undefined; + var certificateAttributes = (options && options.certificateAttributes !== undefined) ? options.certificateAttributes : undefined; + var tags = (options && options.tags !== undefined) ? options.tags : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (certificateName === null || certificateName === undefined || typeof certificateName.valueOf() !== 'string') { + throw new Error('certificateName cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (base64EncodedCertificate === null || base64EncodedCertificate === undefined || typeof base64EncodedCertificate.valueOf() !== 'string') { + throw new Error('base64EncodedCertificate cannot be null or undefined and it must be of type string.'); + } + if (password !== null && password !== undefined && typeof password.valueOf() !== 'string') { + throw new Error('password must be of type string.'); + } + if (tags && typeof tags === 'object') { + for(var valueElement in tags) { + if (tags[valueElement] !== null && tags[valueElement] !== undefined && typeof tags[valueElement].valueOf() !== 'string') { + throw new Error('tags[valueElement] must be of type string.'); + } + } + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + var parameters; + if ((base64EncodedCertificate !== null && base64EncodedCertificate !== undefined) || (password !== null && password !== undefined) || (certificatePolicy !== null && certificatePolicy !== undefined) || (certificateAttributes !== null && certificateAttributes !== undefined) || (tags !== null && tags !== undefined)) { + parameters = new client.models['CertificateImportParameters'](); + parameters.base64EncodedCertificate = base64EncodedCertificate; + parameters.password = password; + parameters.certificatePolicy = certificatePolicy; + parameters.certificateAttributes = certificateAttributes; + parameters.tags = tags; + } + + // Construct URL + var requestUrl = this.baseUri + + '//certificates/{certificate-name}/import'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{certificate-name}', encodeURIComponent(certificateName)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + var requestModelMapper = new client.models['CertificateImportParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['CertificateBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * List the versions of a certificate. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} certificateName The name of the certificate + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.maxresults] Maximum number of results to return. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link CertificateListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getCertificateVersions = function (vaultBaseUrl, certificateName, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + var maxresults = (options && options.maxresults !== undefined) ? options.maxresults : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (certificateName === null || certificateName === undefined || typeof certificateName.valueOf() !== 'string') { + throw new Error('certificateName cannot be null or undefined and it must be of type string.'); + } + if (maxresults !== null && maxresults !== undefined && typeof maxresults !== 'number') { + throw new Error('maxresults must be of type number.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = this.baseUri + + '//certificates/{certificate-name}/versions'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{certificate-name}', encodeURIComponent(certificateName)); + var queryParameters = []; + if (maxresults !== null && maxresults !== undefined) { + queryParameters.push('maxresults=' + encodeURIComponent(maxresults.toString())); + } + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['CertificateListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Gets the policy for a certificate. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} certificateName The name of the certificate in the given + * vault. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link CertificatePolicy} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getCertificatePolicy = function (vaultBaseUrl, certificateName, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (certificateName === null || certificateName === undefined || typeof certificateName.valueOf() !== 'string') { + throw new Error('certificateName cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = this.baseUri + + '//certificates/{certificate-name}/policy'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{certificate-name}', encodeURIComponent(certificateName)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['CertificatePolicy']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Updates the policy for a certificate. Set appropriate members in the + * certificatePolicy that must be updated. Leave others as null. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} certificateName The name of the certificate in the given + * vault. + * + * @param {object} certificatePolicy The policy for the certificate. + * + * @param {object} [certificatePolicy.keyProperties] Properties of the key + * backing a certificate. + * + * @param {boolean} [certificatePolicy.keyProperties.exportable] Indicates if + * the private key can be exported. + * + * @param {string} [certificatePolicy.keyProperties.keyType] The key type. + * + * @param {number} [certificatePolicy.keyProperties.keySize] The key size in + * bytes. e.g. 1024 or 2048. + * + * @param {boolean} [certificatePolicy.keyProperties.reuseKey] Indicates if + * the same key pair will be used on certificate renewal. + * + * @param {object} [certificatePolicy.secretProperties] Properties of the + * secret backing a certificate. + * + * @param {string} [certificatePolicy.secretProperties.contentType] The media + * type (MIME type). + * + * @param {object} [certificatePolicy.x509CertificateProperties] Properties of + * the X509 component of a certificate. + * + * @param {string} [certificatePolicy.x509CertificateProperties.subject] The + * subject name. Should be a valid X509 Distinguished Name. + * + * @param {array} [certificatePolicy.x509CertificateProperties.ekus] The + * enhaunced key usage. + * + * @param {object} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames] The + * subject alternative names. + * + * @param {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @param {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * + * @param {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @param {array} [certificatePolicy.x509CertificateProperties.keyUsage] List + * of key usages. + * + * @param {number} + * [certificatePolicy.x509CertificateProperties.validityInMonths] The subject + * alternate names. + * + * @param {array} [certificatePolicy.lifetimeActions] Actions that will be + * performed by Key Vault over the lifetime of a certificate. + * + * @param {object} [certificatePolicy.issuerReference] Reference to the issuer + * of the X509 component of a certificate. + * + * @param {string} [certificatePolicy.issuerReference.name] Name of the + * referenced issuer object. + * + * @param {object} [certificatePolicy.attributes] The certificate attributes. + * + * @param {boolean} [certificatePolicy.attributes.enabled] Determines whether + * the object is enabled + * + * @param {date} [certificatePolicy.attributes.notBefore] Not before date in + * UTC + * + * @param {date} [certificatePolicy.attributes.expires] Expiry date in UTC + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link CertificatePolicy} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.updateCertificatePolicy = function (vaultBaseUrl, certificateName, certificatePolicy, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (certificateName === null || certificateName === undefined || typeof certificateName.valueOf() !== 'string') { + throw new Error('certificateName cannot be null or undefined and it must be of type string.'); + } + if (certificatePolicy === null || certificatePolicy === undefined) { + throw new Error('certificatePolicy cannot be null or undefined.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = this.baseUri + + '//certificates/{certificate-name}/policy'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{certificate-name}', encodeURIComponent(certificateName)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (certificatePolicy !== null && certificatePolicy !== undefined) { + var requestModelMapper = new client.models['CertificatePolicy']().mapper(); + requestModel = client.serialize(requestModelMapper, certificatePolicy, 'certificatePolicy'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + 'payload - "%s"', error.message, util.inspect(certificatePolicy, {depth: null}))); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['CertificatePolicy']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Updates the attributes associated with the specified certificate + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} certificateName The name of the certificate in the given + * vault + * + * @param {string} certificateVersion The version of the certificate + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional) + * + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled + * + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC + * + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC + * + * @param {object} [options.tags] Application-specific metadata in the form of + * key-value pairs + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link CertificateBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.updateCertificate = function (vaultBaseUrl, certificateName, certificateVersion, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + var certificateAttributes = (options && options.certificateAttributes !== undefined) ? options.certificateAttributes : undefined; + var tags = (options && options.tags !== undefined) ? options.tags : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (certificateName === null || certificateName === undefined || typeof certificateName.valueOf() !== 'string') { + throw new Error('certificateName cannot be null or undefined and it must be of type string.'); + } + if (certificateVersion === null || certificateVersion === undefined || typeof certificateVersion.valueOf() !== 'string') { + throw new Error('certificateVersion cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (tags && typeof tags === 'object') { + for(var valueElement in tags) { + if (tags[valueElement] !== null && tags[valueElement] !== undefined && typeof tags[valueElement].valueOf() !== 'string') { + throw new Error('tags[valueElement] must be of type string.'); + } + } + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + var parameters; + if ((certificateAttributes !== null && certificateAttributes !== undefined) || (tags !== null && tags !== undefined)) { + parameters = new client.models['CertificateUpdateParameters'](); + parameters.certificateAttributes = certificateAttributes; + parameters.tags = tags; + } + + // Construct URL + var requestUrl = this.baseUri + + '//certificates/{certificate-name}/{certificate-version}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{certificate-name}', encodeURIComponent(certificateName)); + requestUrl = requestUrl.replace('{certificate-version}', encodeURIComponent(certificateVersion)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + var requestModelMapper = new client.models['CertificateUpdateParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['CertificateBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Gets a Certificate. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} certificateName The name of the certificate in the given + * vault + * + * @param {string} certificateVersion The version of the certificate + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link CertificateBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getCertificate = function (vaultBaseUrl, certificateName, certificateVersion, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (certificateName === null || certificateName === undefined || typeof certificateName.valueOf() !== 'string') { + throw new Error('certificateName cannot be null or undefined and it must be of type string.'); + } + if (certificateVersion === null || certificateVersion === undefined || typeof certificateVersion.valueOf() !== 'string') { + throw new Error('certificateVersion cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = this.baseUri + + '//certificates/{certificate-name}/{certificate-version}'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{certificate-name}', encodeURIComponent(certificateName)); + requestUrl = requestUrl.replace('{certificate-version}', encodeURIComponent(certificateVersion)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['CertificateBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Updates a certificate operation. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} certificateName The name of the certificate + * + * @param {object} certificateOperation The certificate operation response. + * + * @param {object} [certificateOperation.issuerReference] Reference to the + * issuer of the X509 component of a certificate. + * + * @param {string} [certificateOperation.issuerReference.name] Name of the + * referenced issuer object. + * + * @param {buffer} [certificateOperation.csr] The Certificate Signing Request + * (CSR) that is being used in the certificate operation. + * + * @param {boolean} [certificateOperation.cancellationRequested] Indicates if + * cancellation was requested on the certificate operation. + * + * @param {string} [certificateOperation.status] Status of the certificate + * operation. + * + * @param {string} [certificateOperation.statusDetails] The status details of + * the certificate operation. + * + * @param {object} [certificateOperation.error] Error encountered, if any, + * during the certificate operation. + * + * @param {string} [certificateOperation.target] Location which contains the + * result of the certificate operation. + * + * @param {string} [certificateOperation.requestId] Identifier for the + * certificate operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link CertificateOperation} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.updateCertificateOperation = function (vaultBaseUrl, certificateName, certificateOperation, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (certificateName === null || certificateName === undefined || typeof certificateName.valueOf() !== 'string') { + throw new Error('certificateName cannot be null or undefined and it must be of type string.'); + } + if (certificateOperation === null || certificateOperation === undefined) { + throw new Error('certificateOperation cannot be null or undefined.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = this.baseUri + + '//certificates/{certificate-name}/pending'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{certificate-name}', encodeURIComponent(certificateName)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (certificateOperation !== null && certificateOperation !== undefined) { + var requestModelMapper = new client.models['CertificateOperation']().mapper(); + requestModel = client.serialize(requestModelMapper, certificateOperation, 'certificateOperation'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + 'payload - "%s"', error.message, util.inspect(certificateOperation, {depth: null}))); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['CertificateOperation']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Gets the certificate operation response. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} certificateName The name of the certificate + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link CertificateOperation} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getCertificateOperation = function (vaultBaseUrl, certificateName, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (certificateName === null || certificateName === undefined || typeof certificateName.valueOf() !== 'string') { + throw new Error('certificateName cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = this.baseUri + + '//certificates/{certificate-name}/pending'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{certificate-name}', encodeURIComponent(certificateName)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['CertificateOperation']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Deletes the certificate operation. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} certificateName The name of the certificate + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link CertificateOperation} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.deleteCertificateOperation = function (vaultBaseUrl, certificateName, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (certificateName === null || certificateName === undefined || typeof certificateName.valueOf() !== 'string') { + throw new Error('certificateName cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = this.baseUri + + '//certificates/{certificate-name}/pending'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{certificate-name}', encodeURIComponent(certificateName)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['CertificateOperation']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Merges a certificate or a certificate chain with a key pair existing on the + * server. + * + * @param {string} vaultBaseUrl The vault name, e.g. + * https://myvault.vault.azure.net + * + * @param {string} certificateName The name of the certificate + * + * @param {array} x509Certificates The certificate or the certificate chain to + * merge + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.certificateAttributes] The attributes of the + * certificate (optional) + * + * @param {boolean} [options.certificateAttributes.enabled] Determines whether + * the object is enabled + * + * @param {date} [options.certificateAttributes.notBefore] Not before date in + * UTC + * + * @param {date} [options.certificateAttributes.expires] Expiry date in UTC + * + * @param {object} [options.tags] Application-specific metadata in the form of + * key-value pairs + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link CertificateBundle} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.mergeCertificate = function (vaultBaseUrl, certificateName, x509Certificates, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + var certificateAttributes = (options && options.certificateAttributes !== undefined) ? options.certificateAttributes : undefined; + var tags = (options && options.tags !== undefined) ? options.tags : undefined; + // Validate + try { + if (vaultBaseUrl === null || vaultBaseUrl === undefined || typeof vaultBaseUrl.valueOf() !== 'string') { + throw new Error('vaultBaseUrl cannot be null or undefined and it must be of type string.'); + } + if (certificateName === null || certificateName === undefined || typeof certificateName.valueOf() !== 'string') { + throw new Error('certificateName cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (!util.isArray(x509Certificates)) { + throw new Error('x509Certificates cannot be null or undefined and it must be of type array.'); + } + for (var i = 0; i < x509Certificates.length; i++) { + if (x509Certificates[i] && !Buffer.isBuffer(x509Certificates[i])) { + throw new Error('x509Certificates[i] must be of type buffer.'); + } + } + if (tags && typeof tags === 'object') { + for(var valueElement in tags) { + if (tags[valueElement] !== null && tags[valueElement] !== undefined && typeof tags[valueElement].valueOf() !== 'string') { + throw new Error('tags[valueElement] must be of type string.'); + } + } + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + var parameters; + if ((x509Certificates !== null && x509Certificates !== undefined) || (certificateAttributes !== null && certificateAttributes !== undefined) || (tags !== null && tags !== undefined)) { + parameters = new client.models['CertificateMergeParameters'](); + parameters.x509Certificates = x509Certificates; + parameters.certificateAttributes = certificateAttributes; + parameters.tags = tags; + } + + // Construct URL + var requestUrl = this.baseUri + + '//certificates/{certificate-name}/pending/merge'; + requestUrl = requestUrl.replace('{vaultBaseUrl}', vaultBaseUrl); + requestUrl = requestUrl.replace('{certificate-name}', encodeURIComponent(certificateName)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + var requestModelMapper = new client.models['CertificateMergeParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 201) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 201) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['CertificateBundle']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * List the versions of the specified key + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link KeyListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getKeyVersionsNext = function (nextPageLink, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['KeyListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * List keys in the specified vault + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link KeyListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getKeysNext = function (nextPageLink, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['KeyListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * List secrets in the specified vault + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link SecretListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getSecretsNext = function (nextPageLink, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['SecretListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * List the versions of the specified secret + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link SecretListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getSecretVersionsNext = function (nextPageLink, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['SecretListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * List certificates in the specified vault + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link CertificateListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getCertificatesNext = function (nextPageLink, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['CertificateListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * List certificate issuers for the specified vault. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link CertificateIssuerListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getCertificateIssuersNext = function (nextPageLink, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['CertificateIssuerListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * List the versions of a certificate. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link CertificateListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +KeyVaultClient.prototype.getCertificateVersionsNext = function (nextPageLink, options, callback) { + var client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['KeyVaultError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['CertificateListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +module.exports = KeyVaultClient; diff --git a/lib/services/keyVault/lib/keyVaultCredentials.js b/lib/services/keyVault/lib/keyVaultCredentials.js index 6c1c1a603..2da2d1286 100644 --- a/lib/services/keyVault/lib/keyVaultCredentials.js +++ b/lib/services/keyVault/lib/keyVaultCredentials.js @@ -18,9 +18,9 @@ /* jshint latedef:false */ var Url = require('url'); -var AzureCommon = require('azure-common'); -var HeaderConstants = AzureCommon.Constants.HeaderConstants; -var requestPipeline = AzureCommon.requestPipeline; +var msRest = require('ms-rest'); +var HeaderConstants = msRest.Constants.HeaderConstants; +var requestPipeline = msRest.requestPipeline; /** * An object that performs authentication for Key Vault. @@ -178,4 +178,4 @@ function getAuthority(uri) { } result += host; return result; -} +} \ No newline at end of file diff --git a/lib/services/keyVault/lib/keyVaultInternalClient.js b/lib/services/keyVault/lib/keyVaultInternalClient.js deleted file mode 100644 index ef6ca2672..000000000 --- a/lib/services/keyVault/lib/keyVaultInternalClient.js +++ /dev/null @@ -1,1946 +0,0 @@ -/* jshint latedef:false */ -/* jshint forin:false */ -/* jshint noempty:false */ - -// -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// - -// Warning: This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if the -// code is regenerated. - -'use strict'; - -var util = require('util'); -var uuid = require('node-uuid'); -var azureCommon = require('azure-common'); -var Service = azureCommon.Service; -var WebResource = azureCommon.WebResource; - -var DEFAULT_API_VERSION = '2015-06-01'; -var API_VERSION_QUERY_PARAM = 'api-version=' + DEFAULT_API_VERSION; - -var KeyVaultInternalClient = ( /** @lends KeyVaultInternalClient */ function() { - /* (jsdoc off) - * @class - * Initializes a new instance of the KeyVaultInternalClient class. - * @constructor - * - * @param {KeyVaultCredential} credentials Gets or sets the credential - * - * @param {string} [baseUri] Gets the URI used as the base for all cloud - * service requests. - * - * @param {Array} filters - */ - function KeyVaultInternalClient(credentials, baseUri, filters) { - if (credentials === null || credentials === undefined) { - throw new Error('credentials cannot be null.'); - } - - KeyVaultInternalClient['super_'].call(this, credentials, filters); - - this.credentials = credentials; - this.baseUri = baseUri; - if (this.baseUri === null || this.baseUri === undefined) { - this.baseUri = null; - } - if (this.apiVersion === null || this.apiVersion === undefined) { - this.apiVersion = DEFAULT_API_VERSION; - } - if (this.longRunningOperationInitialTimeout === null || this.longRunningOperationInitialTimeout === undefined) { - this.longRunningOperationInitialTimeout = -1; - } - if (this.longRunningOperationRetryTimeout === null || this.longRunningOperationRetryTimeout === undefined) { - this.longRunningOperationRetryTimeout = -1; - } - /** - * Provides an instance of the [KeyOperations](-KeyOperations.html) object. - * @type {object} - */ - this.keys = new KeyOperations(this); - /** - * Provides an instance of the [SecretOperations](-SecretOperations.html) - * object. - * @type {object} - */ - this.secrets = new SecretOperations(this); - } - - util.inherits(KeyVaultInternalClient, Service); - - - return KeyVaultInternalClient; -})(); -exports.KeyVaultInternalClient = KeyVaultInternalClient; - -var KeyOperations = ( /** @lends KeyOperations */ function() { - /* (jsdoc off) - * @class - * Cryptographic and management operations for keys in a vault - * __NOTE__: An instance of this class is automatically created for an - * instance of the [KeyVaultInternalClient] {@link - * KeyVaultInternalClient~KeyVaultInternalClient}. - * See [keys] {@link KeyVaultInternalClient~KeyVaultInternalClient#keys}. - * Initializes a new instance of the KeyOperations class. - * @constructor - * - * @param {KeyVaultInternalClient} client Reference to the service client. - */ - function KeyOperations(client) { - this.client = client; - } - - /** - * Requests that a backup of the specified key be downloaded to the client. - * - * @param {string} keyIdentifier - * - * @param {function} callback - * - * @returns {Stream} The response stream. - */ - KeyOperations.prototype.backup = function(keyIdentifier, callback) { - if (callback === null || callback === undefined) { - throw new Error('callback cannot be null.'); - } - // Validate - if (keyIdentifier === null || keyIdentifier === undefined) { - return callback(new Error('keyIdentifier cannot be null.')); - } - - // Tracing - - // Construct URL - var url2 = ''; - url2 = url2 + keyIdentifier; - url2 = url2 + '/backup'; - var queryParameters = []; - queryParameters.push(API_VERSION_QUERY_PARAM); - if (queryParameters.length > 0) { - url2 = url2 + '?' + queryParameters.join('&'); - } - url2 = url2.replace(' ', '%20'); - - // Create HTTP transport objects - var httpRequest = new WebResource(); - httpRequest.method = 'POST'; - httpRequest.headers = {}; - httpRequest.url = url2; - - // Set Headers - httpRequest.headers['Accept'] = 'application/json'; - httpRequest.headers['client-request-id'] = uuid(); - httpRequest.headers['Content-Type'] = 'application/json'; - - // Serialize Request - var requestContent = '{}'; - httpRequest.body = requestContent; - httpRequest.headers['Content-Length'] = Buffer.byteLength(requestContent, 'UTF8'); - - // Send Request - return this.client.pipeline(httpRequest, function (err, response, body) { - if (err !== null && err !== undefined) { - return callback(err); - } - var statusCode = response.statusCode; - if (statusCode >= 400) { - var error = new Error(body); - error.statusCode = response.statusCode; - return callback(error); - } - - // Create Result - var result = null; - // Deserialize Response - var responseContent = body; - result = {}; - result.keyOpResponse = responseContent; - - result.statusCode = statusCode; - - return callback(null, result); - }); - }; - - /** - * Creates a new, named, key in the specified vault. - * - * @param {string} vault - * - * @param {string} keyName - * - * @param {KeyOpRequestMessageWithRawJsonContent} keyOpRequest - * - * @param {string} [keyOpRequest.rawJsonRequest] - * - * @param {function} callback - * - * @returns {Stream} The response stream. - */ - KeyOperations.prototype.create = function(vault, keyName, keyOpRequest, callback) { - if (callback === null || callback === undefined) { - throw new Error('callback cannot be null.'); - } - // Validate - if (vault === null || vault === undefined) { - return callback(new Error('vault cannot be null.')); - } - if (keyName === null || keyName === undefined) { - return callback(new Error('keyName cannot be null.')); - } - if (keyOpRequest === null || keyOpRequest === undefined) { - return callback(new Error('keyOpRequest cannot be null.')); - } - - // Tracing - - // Construct URL - var url2 = ''; - url2 = url2 + vault; - url2 = url2 + '/keys/'; - url2 = url2 + encodeURIComponent(keyName); - url2 = url2 + '/create'; - var queryParameters = []; - queryParameters.push(API_VERSION_QUERY_PARAM); - if (queryParameters.length > 0) { - url2 = url2 + '?' + queryParameters.join('&'); - } - url2 = url2.replace(' ', '%20'); - - // Create HTTP transport objects - var httpRequest = new WebResource(); - httpRequest.method = 'POST'; - httpRequest.headers = {}; - httpRequest.url = url2; - - // Set Headers - httpRequest.headers['Accept'] = 'application/json'; - httpRequest.headers['client-request-id'] = uuid(); - httpRequest.headers['Content-Type'] = 'application/json'; - - // Serialize Request - var requestContent = keyOpRequest.rawJsonRequest; - httpRequest.body = requestContent; - httpRequest.headers['Content-Length'] = Buffer.isBuffer(requestContent) ? requestContent.length : Buffer.byteLength(requestContent, 'UTF8'); - // Send Request - return this.client.pipeline(httpRequest, function (err, response, body) { - if (err !== null && err !== undefined) { - return callback(err); - } - var statusCode = response.statusCode; - if (statusCode >= 400) { - var error = new Error(body); - error.statusCode = response.statusCode; - return callback(error); - } - - // Create Result - var result = null; - // Deserialize Response - var responseContent = body; - result = {}; - result.keyOpResponse = responseContent; - - result.statusCode = statusCode; - - return callback(null, result); - }); - }; - - /** - * Decrypts a single block of data. - * - * @param {string} keyIdentifier - * - * @param {KeyOpRequestMessageWithRawJsonContent} keyOpRequest - * - * @param {string} [keyOpRequest.rawJsonRequest] - * - * @param {function} callback - * - * @returns {Stream} The response stream. - */ - KeyOperations.prototype.decryptData = function(keyIdentifier, keyOpRequest, callback) { - if (callback === null || callback === undefined) { - throw new Error('callback cannot be null.'); - } - // Validate - if (keyIdentifier === null || keyIdentifier === undefined) { - return callback(new Error('keyIdentifier cannot be null.')); - } - if (keyOpRequest === null || keyOpRequest === undefined) { - return callback(new Error('keyOpRequest cannot be null.')); - } - - // Tracing - - // Construct URL - var url2 = ''; - url2 = url2 + keyIdentifier; - url2 = url2 + '/decrypt'; - var queryParameters = []; - queryParameters.push(API_VERSION_QUERY_PARAM); - if (queryParameters.length > 0) { - url2 = url2 + '?' + queryParameters.join('&'); - } - url2 = url2.replace(' ', '%20'); - - // Create HTTP transport objects - var httpRequest = new WebResource(); - httpRequest.method = 'POST'; - httpRequest.headers = {}; - httpRequest.url = url2; - - // Set Headers - httpRequest.headers['client-request-id'] = uuid(); - httpRequest.headers['Content-Type'] = 'application/json'; - - // Serialize Request - var requestContent = keyOpRequest.rawJsonRequest; - httpRequest.body = requestContent; - httpRequest.headers['Content-Length'] = Buffer.isBuffer(requestContent) ? requestContent.length : Buffer.byteLength(requestContent, 'UTF8'); - // Send Request - return this.client.pipeline(httpRequest, function (err, response, body) { - if (err !== null && err !== undefined) { - return callback(err); - } - var statusCode = response.statusCode; - if (statusCode >= 400) { - var error = new Error(body); - error.statusCode = response.statusCode; - return callback(error); - } - - // Create Result - var result = null; - // Deserialize Response - var responseContent = body; - result = {}; - result.keyOpResponse = responseContent; - - result.statusCode = statusCode; - - return callback(null, result); - }); - }; - - /** - * Delete the specified key - * - * @param {string} vault - * - * @param {string} keyName - * - * @param {function} callback - * - * @returns {Stream} The response stream. - */ - KeyOperations.prototype.deleteKey = function(vault, keyName, callback) { - if (callback === null || callback === undefined) { - throw new Error('callback cannot be null.'); - } - // Validate - if (vault === null || vault === undefined) { - return callback(new Error('vault cannot be null.')); - } - if (keyName === null || keyName === undefined) { - return callback(new Error('keyName cannot be null.')); - } - - // Tracing - - // Construct URL - var url2 = ''; - url2 = url2 + vault; - url2 = url2 + '/keys/'; - url2 = url2 + encodeURIComponent(keyName); - url2 = url2 + '/delete'; - var queryParameters = []; - queryParameters.push(API_VERSION_QUERY_PARAM); - if (queryParameters.length > 0) { - url2 = url2 + '?' + queryParameters.join('&'); - } - url2 = url2.replace(' ', '%20'); - - // Create HTTP transport objects - var httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; - httpRequest.headers = {}; - httpRequest.url = url2; - - // Set Headers - httpRequest.headers['Accept'] = 'application/json'; - httpRequest.headers['client-request-id'] = uuid(); - - // Send Request - return this.client.pipeline(httpRequest, function (err, response, body) { - if (err !== null && err !== undefined) { - return callback(err); - } - var statusCode = response.statusCode; - if (statusCode >= 400) { - var error = new Error(body); - error.statusCode = response.statusCode; - return callback(error); - } - - // Create Result - var result = null; - // Deserialize Response - var responseContent = body; - result = {}; - result.keyOpResponse = responseContent; - - result.statusCode = statusCode; - - return callback(null, result); - }); - }; - - /** - * Encrypts a single block of data. - * - * @param {string} keyIdentifier - * - * @param {KeyOpRequestMessageWithRawJsonContent} keyOpRequest - * - * @param {string} [keyOpRequest.rawJsonRequest] - * - * @param {function} callback - * - * @returns {Stream} The response stream. - */ - KeyOperations.prototype.encryptData = function(keyIdentifier, keyOpRequest, callback) { - if (callback === null || callback === undefined) { - throw new Error('callback cannot be null.'); - } - // Validate - if (keyIdentifier === null || keyIdentifier === undefined) { - return callback(new Error('keyIdentifier cannot be null.')); - } - if (keyOpRequest === null || keyOpRequest === undefined) { - return callback(new Error('keyOpRequest cannot be null.')); - } - - // Tracing - - // Construct URL - var url2 = ''; - url2 = url2 + keyIdentifier; - url2 = url2 + '/encrypt'; - var queryParameters = []; - queryParameters.push(API_VERSION_QUERY_PARAM); - if (queryParameters.length > 0) { - url2 = url2 + '?' + queryParameters.join('&'); - } - url2 = url2.replace(' ', '%20'); - - // Create HTTP transport objects - var httpRequest = new WebResource(); - httpRequest.method = 'POST'; - httpRequest.headers = {}; - httpRequest.url = url2; - - // Set Headers - httpRequest.headers['client-request-id'] = uuid(); - httpRequest.headers['Content-Type'] = 'application/json'; - - // Serialize Request - var requestContent = keyOpRequest.rawJsonRequest; - httpRequest.body = requestContent; - httpRequest.headers['Content-Length'] = Buffer.isBuffer(requestContent) ? requestContent.length : Buffer.byteLength(requestContent, 'UTF8'); - // Send Request - return this.client.pipeline(httpRequest, function (err, response, body) { - if (err !== null && err !== undefined) { - return callback(err); - } - var statusCode = response.statusCode; - if (statusCode >= 400) { - var error = new Error(body); - error.statusCode = response.statusCode; - return callback(error); - } - - // Create Result - var result = null; - // Deserialize Response - var responseContent = body; - result = {}; - result.keyOpResponse = responseContent; - - result.statusCode = statusCode; - - return callback(null, result); - }); - }; - - /** - * Retrieves the public portion of a key plus its attributes - * - * @param {string} keyIdentifier - * - * @param {function} callback - * - * @returns {Stream} The response stream. - */ - KeyOperations.prototype.get = function(keyIdentifier, callback) { - if (callback === null || callback === undefined) { - throw new Error('callback cannot be null.'); - } - // Validate - if (keyIdentifier === null || keyIdentifier === undefined) { - return callback(new Error('keyIdentifier cannot be null.')); - } - - // Tracing - - // Construct URL - var url2 = ''; - url2 = url2 + keyIdentifier; - url2 = url2 + '/'; - var queryParameters = []; - queryParameters.push(API_VERSION_QUERY_PARAM); - if (queryParameters.length > 0) { - url2 = url2 + '?' + queryParameters.join('&'); - } - url2 = url2.replace(' ', '%20'); - - // Create HTTP transport objects - var httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.headers = {}; - httpRequest.url = url2; - - // Set Headers - httpRequest.headers['Accept'] = 'application/json'; - httpRequest.headers['client-request-id'] = uuid(); - - // Send Request - return this.client.pipeline(httpRequest, function (err, response, body) { - if (err !== null && err !== undefined) { - return callback(err); - } - var statusCode = response.statusCode; - if (statusCode >= 400) { - var error = new Error(body); - error.statusCode = response.statusCode; - return callback(error); - } - - // Create Result - var result = null; - // Deserialize Response - var responseContent = body; - result = {}; - result.keyOpResponse = responseContent; - - result.statusCode = statusCode; - - return callback(null, result); - }); - }; - - /** - * Imports a key into the specified vault - * - * @param {string} keyIdentifier - * - * @param {KeyOpRequestMessageWithRawJsonContent} keyOpRequest - * - * @param {string} [keyOpRequest.rawJsonRequest] - * - * @param {function} callback - * - * @returns {Stream} The response stream. - */ - KeyOperations.prototype.importMethod = function(keyIdentifier, keyOpRequest, callback) { - if (callback === null || callback === undefined) { - throw new Error('callback cannot be null.'); - } - // Validate - if (keyIdentifier === null || keyIdentifier === undefined) { - return callback(new Error('keyIdentifier cannot be null.')); - } - if (keyOpRequest === null || keyOpRequest === undefined) { - return callback(new Error('keyOpRequest cannot be null.')); - } - - // Tracing - - // Construct URL - var url2 = ''; - url2 = url2 + keyIdentifier; - url2 = url2 + '/import'; - var queryParameters = []; - queryParameters.push(API_VERSION_QUERY_PARAM); - if (queryParameters.length > 0) { - url2 = url2 + '?' + queryParameters.join('&'); - } - url2 = url2.replace(' ', '%20'); - - // Create HTTP transport objects - var httpRequest = new WebResource(); - httpRequest.method = 'PUT'; - httpRequest.headers = {}; - httpRequest.url = url2; - - // Set Headers - httpRequest.headers['Accept'] = 'application/json'; - httpRequest.headers['client-request-id'] = uuid(); - httpRequest.headers['Content-Type'] = 'application/json'; - - // Serialize Request - var requestContent = keyOpRequest.rawJsonRequest; - httpRequest.body = requestContent; - httpRequest.headers['Content-Length'] = Buffer.isBuffer(requestContent) ? requestContent.length : Buffer.byteLength(requestContent, 'UTF8'); - // Send Request - return this.client.pipeline(httpRequest, function (err, response, body) { - if (err !== null && err !== undefined) { - return callback(err); - } - var statusCode = response.statusCode; - if (statusCode >= 400) { - var error = new Error(body); - error.statusCode = response.statusCode; - return callback(error); - } - - // Create Result - var result = null; - // Deserialize Response - var responseContent = body; - result = {}; - result.keyOpResponse = responseContent; - - result.statusCode = statusCode; - - return callback(null, result); - }); - }; - - /** - * List the keys in the vault - * - * @param {string} vault - * - * @param {Number} [top] - * - * @param {function} callback - * - * @returns {Stream} The response stream. - */ - KeyOperations.prototype.list = function(vault, top, callback) { - if (callback === null || callback === undefined) { - throw new Error('callback cannot be null.'); - } - // Validate - if (vault === null || vault === undefined) { - return callback(new Error('vault cannot be null.')); - } - - // Tracing - - // Construct URL - var url2 = ''; - url2 = url2 + vault; - url2 = url2 + '/keys/'; - var queryParameters = []; - queryParameters.push(API_VERSION_QUERY_PARAM); - if (top !== null && top !== undefined) { - queryParameters.push('maxresults=' + encodeURIComponent(top.toString())); - } - if (queryParameters.length > 0) { - url2 = url2 + '?' + queryParameters.join('&'); - } - url2 = url2.replace(' ', '%20'); - - // Create HTTP transport objects - var httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.headers = {}; - httpRequest.url = url2; - - // Set Headers - httpRequest.headers['Accept'] = 'application/json'; - httpRequest.headers['client-request-id'] = uuid(); - - // Send Request - return this.client.pipeline(httpRequest, function (err, response, body) { - if (err !== null && err !== undefined) { - return callback(err); - } - var statusCode = response.statusCode; - if (statusCode >= 400) { - var error = new Error(body); - error.statusCode = response.statusCode; - return callback(error); - } - - // Create Result - var result = null; - // Deserialize Response - var responseContent = body; - result = {}; - result.keyOpResponse = responseContent; - - result.statusCode = statusCode; - - return callback(null, result); - }); - }; - - /** - * List the next page of keys in the vault - * - * @param {string} nextLink - * - * @param {function} callback - * - * @returns {Stream} The response stream. - */ - KeyOperations.prototype.listNext = function(nextLink, callback) { - if (callback === null || callback === undefined) { - throw new Error('callback cannot be null.'); - } - // Validate - if (nextLink === null || nextLink === undefined) { - return callback(new Error('nextLink cannot be null.')); - } - - // Tracing - - // Construct URL - var url2 = ''; - url2 = url2 + nextLink; - url2 = url2.replace(' ', '%20'); - - // Create HTTP transport objects - var httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.headers = {}; - httpRequest.url = url2; - - // Set Headers - httpRequest.headers['Accept'] = 'application/json'; - httpRequest.headers['client-request-id'] = uuid(); - - // Send Request - return this.client.pipeline(httpRequest, function (err, response, body) { - if (err !== null && err !== undefined) { - return callback(err); - } - var statusCode = response.statusCode; - if (statusCode >= 400) { - var error = new Error(body); - error.statusCode = response.statusCode; - return callback(error); - } - - // Create Result - var result = null; - // Deserialize Response - var responseContent = body; - result = {}; - result.keyOpResponse = responseContent; - - result.statusCode = statusCode; - - return callback(null, result); - }); - }; - - /** - * List the versions of a key - * - * @param {string} vault - * - * @param {string} keyName - * - * @param {Number} [top] - * - * @param {function} callback - * - * @returns {Stream} The response stream. - */ - KeyOperations.prototype.listVersions = function(vault, keyName, top, callback) { - if (callback === null || callback === undefined) { - throw new Error('callback cannot be null.'); - } - // Validate - if (vault === null || vault === undefined) { - return callback(new Error('vault cannot be null.')); - } - if (keyName === null || keyName === undefined) { - return callback(new Error('keyName cannot be null.')); - } - - // Tracing - - // Construct URL - var url2 = ''; - url2 = url2 + vault; - url2 = url2 + '/keys/'; - url2 = url2 + encodeURIComponent(keyName); - url2 = url2 + '/versions'; - var queryParameters = []; - queryParameters.push(API_VERSION_QUERY_PARAM); - if (top !== null && top !== undefined) { - queryParameters.push('maxresults=' + encodeURIComponent(top.toString())); - } - if (queryParameters.length > 0) { - url2 = url2 + '?' + queryParameters.join('&'); - } - url2 = url2.replace(' ', '%20'); - - // Create HTTP transport objects - var httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.headers = {}; - httpRequest.url = url2; - - // Set Headers - httpRequest.headers['Accept'] = 'application/json'; - httpRequest.headers['client-request-id'] = uuid(); - - // Send Request - return this.client.pipeline(httpRequest, function (err, response, body) { - if (err !== null && err !== undefined) { - return callback(err); - } - var statusCode = response.statusCode; - if (statusCode >= 400) { - var error = new Error(body); - error.statusCode = response.statusCode; - return callback(error); - } - - // Create Result - var result = null; - // Deserialize Response - var responseContent = body; - result = {}; - result.keyOpResponse = responseContent; - - result.statusCode = statusCode; - - return callback(null, result); - }); - }; - - /** - * List the next page of versions of a key - * - * @param {string} nextLink - * - * @param {function} callback - * - * @returns {Stream} The response stream. - */ - KeyOperations.prototype.listVersionsNext = function(nextLink, callback) { - if (callback === null || callback === undefined) { - throw new Error('callback cannot be null.'); - } - // Validate - if (nextLink === null || nextLink === undefined) { - return callback(new Error('nextLink cannot be null.')); - } - - // Tracing - - // Construct URL - var url2 = ''; - url2 = url2 + nextLink; - url2 = url2.replace(' ', '%20'); - - // Create HTTP transport objects - var httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.headers = {}; - httpRequest.url = url2; - - // Set Headers - httpRequest.headers['Accept'] = 'application/json'; - httpRequest.headers['client-request-id'] = uuid(); - - // Send Request - return this.client.pipeline(httpRequest, function (err, response, body) { - if (err !== null && err !== undefined) { - return callback(err); - } - var statusCode = response.statusCode; - if (statusCode >= 400) { - var error = new Error(body); - error.statusCode = response.statusCode; - return callback(error); - } - - // Create Result - var result = null; - // Deserialize Response - var responseContent = body; - result = {}; - result.keyOpResponse = responseContent; - - result.statusCode = statusCode; - - return callback(null, result); - }); - }; - - /** - * Restores the backup key in to a vault - * - * @param {string} vault - * - * @param {KeyOpRequestMessageWithRawJsonContent} keyOpRequest - * - * @param {string} [keyOpRequest.rawJsonRequest] - * - * @param {function} callback - * - * @returns {Stream} The response stream. - */ - KeyOperations.prototype.restore = function(vault, keyOpRequest, callback) { - if (callback === null || callback === undefined) { - throw new Error('callback cannot be null.'); - } - // Validate - if (vault === null || vault === undefined) { - return callback(new Error('vault cannot be null.')); - } - if (keyOpRequest === null || keyOpRequest === undefined) { - return callback(new Error('keyOpRequest cannot be null.')); - } - - // Tracing - - // Construct URL - var url2 = ''; - url2 = url2 + vault; - url2 = url2 + '/keys/restore'; - var queryParameters = []; - queryParameters.push(API_VERSION_QUERY_PARAM); - if (queryParameters.length > 0) { - url2 = url2 + '?' + queryParameters.join('&'); - } - url2 = url2.replace(' ', '%20'); - - // Create HTTP transport objects - var httpRequest = new WebResource(); - httpRequest.method = 'POST'; - httpRequest.headers = {}; - httpRequest.url = url2; - - // Set Headers - httpRequest.headers['Accept'] = 'application/json'; - httpRequest.headers['client-request-id'] = uuid(); - httpRequest.headers['Content-Type'] = 'application/json'; - - // Serialize Request - var requestContent = keyOpRequest.rawJsonRequest; - httpRequest.body = requestContent; - httpRequest.headers['Content-Length'] = Buffer.isBuffer(requestContent) ? requestContent.length : Buffer.byteLength(requestContent, 'UTF8'); - // Send Request - return this.client.pipeline(httpRequest, function (err, response, body) { - if (err !== null && err !== undefined) { - return callback(err); - } - var statusCode = response.statusCode; - if (statusCode >= 400) { - var error = new Error(body); - error.statusCode = response.statusCode; - return callback(error); - } - - // Create Result - var result = null; - // Deserialize Response - var responseContent = body; - result = {}; - result.keyOpResponse = responseContent; - - result.statusCode = statusCode; - - return callback(null, result); - }); - }; - - /** - * Creates a signature from a digest using the specified key in the vault - * - * @param {string} keyIdentifier - * - * @param {KeyOpRequestMessageWithRawJsonContent} keyOpRequest - * - * @param {string} [keyOpRequest.rawJsonRequest] - * - * @param {function} callback - * - * @returns {Stream} The response stream. - */ - KeyOperations.prototype.sign = function(keyIdentifier, keyOpRequest, callback) { - if (callback === null || callback === undefined) { - throw new Error('callback cannot be null.'); - } - // Validate - if (keyIdentifier === null || keyIdentifier === undefined) { - return callback(new Error('keyIdentifier cannot be null.')); - } - if (keyOpRequest === null || keyOpRequest === undefined) { - return callback(new Error('keyOpRequest cannot be null.')); - } - - // Tracing - - // Construct URL - var url2 = ''; - url2 = url2 + keyIdentifier; - url2 = url2 + '/sign'; - var queryParameters = []; - queryParameters.push(API_VERSION_QUERY_PARAM); - if (queryParameters.length > 0) { - url2 = url2 + '?' + queryParameters.join('&'); - } - url2 = url2.replace(' ', '%20'); - - // Create HTTP transport objects - var httpRequest = new WebResource(); - httpRequest.method = 'POST'; - httpRequest.headers = {}; - httpRequest.url = url2; - - // Set Headers - httpRequest.headers['client-request-id'] = uuid(); - httpRequest.headers['Content-Type'] = 'application/json'; - - // Serialize Request - var requestContent = keyOpRequest.rawJsonRequest; - httpRequest.body = requestContent; - httpRequest.headers['Content-Length'] = Buffer.isBuffer(requestContent) ? requestContent.length : Buffer.byteLength(requestContent, 'UTF8'); - // Send Request - return this.client.pipeline(httpRequest, function (err, response, body) { - if (err !== null && err !== undefined) { - return callback(err); - } - var statusCode = response.statusCode; - if (statusCode >= 400) { - var error = new Error(body); - error.statusCode = response.statusCode; - return callback(error); - } - - // Create Result - var result = null; - // Deserialize Response - var responseContent = body; - result = {}; - result.keyOpResponse = responseContent; - - result.statusCode = statusCode; - - return callback(null, result); - }); - }; - - /** - * Unwraps a symmetric key using the specified key in the vault - * - * @param {string} keyIdentifier - * - * @param {KeyOpRequestMessageWithRawJsonContent} keyOpRequest - * - * @param {string} [keyOpRequest.rawJsonRequest] - * - * @param {function} callback - * - * @returns {Stream} The response stream. - */ - KeyOperations.prototype.unwrapKey = function(keyIdentifier, keyOpRequest, callback) { - if (callback === null || callback === undefined) { - throw new Error('callback cannot be null.'); - } - // Validate - if (keyIdentifier === null || keyIdentifier === undefined) { - return callback(new Error('keyIdentifier cannot be null.')); - } - if (keyOpRequest === null || keyOpRequest === undefined) { - return callback(new Error('keyOpRequest cannot be null.')); - } - - // Tracing - - // Construct URL - var url2 = ''; - url2 = url2 + keyIdentifier; - url2 = url2 + '/unwrapkey'; - var queryParameters = []; - queryParameters.push(API_VERSION_QUERY_PARAM); - if (queryParameters.length > 0) { - url2 = url2 + '?' + queryParameters.join('&'); - } - url2 = url2.replace(' ', '%20'); - - // Create HTTP transport objects - var httpRequest = new WebResource(); - httpRequest.method = 'POST'; - httpRequest.headers = {}; - httpRequest.url = url2; - - // Set Headers - httpRequest.headers['client-request-id'] = uuid(); - httpRequest.headers['Content-Type'] = 'application/json'; - - // Serialize Request - var requestContent = keyOpRequest.rawJsonRequest; - httpRequest.body = requestContent; - httpRequest.headers['Content-Length'] = Buffer.isBuffer(requestContent) ? requestContent.length : Buffer.byteLength(requestContent, 'UTF8'); - // Send Request - return this.client.pipeline(httpRequest, function (err, response, body) { - if (err !== null && err !== undefined) { - return callback(err); - } - var statusCode = response.statusCode; - if (statusCode >= 400) { - var error = new Error(body); - error.statusCode = response.statusCode; - return callback(error); - } - - // Create Result - var result = null; - // Deserialize Response - var responseContent = body; - result = {}; - result.keyOpResponse = responseContent; - - result.statusCode = statusCode; - - return callback(null, result); - }); - }; - - /** - * Updates the Key Attributes associated with the specified key - * - * @param {string} keyIdentifier - * - * @param {KeyOpRequestMessageWithRawJsonContent} keyOpRequest - * - * @param {string} [keyOpRequest.rawJsonRequest] - * - * @param {function} callback - * - * @returns {Stream} The response stream. - */ - KeyOperations.prototype.update = function(keyIdentifier, keyOpRequest, callback) { - if (callback === null || callback === undefined) { - throw new Error('callback cannot be null.'); - } - // Validate - if (keyIdentifier === null || keyIdentifier === undefined) { - return callback(new Error('keyIdentifier cannot be null.')); - } - if (keyOpRequest === null || keyOpRequest === undefined) { - return callback(new Error('keyOpRequest cannot be null.')); - } - - // Tracing - - // Construct URL - var url2 = ''; - url2 = url2 + keyIdentifier; - url2 = url2 + '/update'; - var queryParameters = []; - queryParameters.push(API_VERSION_QUERY_PARAM); - if (queryParameters.length > 0) { - url2 = url2 + '?' + queryParameters.join('&'); - } - url2 = url2.replace(' ', '%20'); - - // Create HTTP transport objects - var httpRequest = new WebResource(); - httpRequest.method = 'PATCH'; - httpRequest.headers = {}; - httpRequest.url = url2; - - // Set Headers - httpRequest.headers['Accept'] = 'application/json'; - httpRequest.headers['client-request-id'] = uuid(); - httpRequest.headers['Content-Type'] = 'application/json'; - - // Serialize Request - var requestContent = keyOpRequest.rawJsonRequest; - httpRequest.body = requestContent; - httpRequest.headers['Content-Length'] = Buffer.isBuffer(requestContent) ? requestContent.length : Buffer.byteLength(requestContent, 'UTF8'); - // Send Request - return this.client.pipeline(httpRequest, function (err, response, body) { - if (err !== null && err !== undefined) { - return callback(err); - } - var statusCode = response.statusCode; - if (statusCode >= 400) { - var error = new Error(body); - error.statusCode = response.statusCode; - return callback(error); - } - - // Create Result - var result = null; - // Deserialize Response - var responseContent = body; - result = {}; - result.keyOpResponse = responseContent; - - result.statusCode = statusCode; - - return callback(null, result); - }); - }; - - /** - * Verifies a signature using the specified key - * - * @param {string} keyIdentifier - * - * @param {KeyOpRequestMessageWithRawJsonContent} keyOpRequest - * - * @param {string} [keyOpRequest.rawJsonRequest] - * - * @param {function} callback - * - * @returns {Stream} The response stream. - */ - KeyOperations.prototype.verify = function(keyIdentifier, keyOpRequest, callback) { - if (callback === null || callback === undefined) { - throw new Error('callback cannot be null.'); - } - // Validate - if (keyIdentifier === null || keyIdentifier === undefined) { - return callback(new Error('keyIdentifier cannot be null.')); - } - if (keyOpRequest === null || keyOpRequest === undefined) { - return callback(new Error('keyOpRequest cannot be null.')); - } - - // Tracing - - // Construct URL - var url2 = ''; - url2 = url2 + keyIdentifier; - url2 = url2 + '/verify'; - var queryParameters = []; - queryParameters.push(API_VERSION_QUERY_PARAM); - if (queryParameters.length > 0) { - url2 = url2 + '?' + queryParameters.join('&'); - } - url2 = url2.replace(' ', '%20'); - - // Create HTTP transport objects - var httpRequest = new WebResource(); - httpRequest.method = 'POST'; - httpRequest.headers = {}; - httpRequest.url = url2; - - // Set Headers - httpRequest.headers['client-request-id'] = uuid(); - httpRequest.headers['Content-Type'] = 'application/json'; - - // Serialize Request - var requestContent = keyOpRequest.rawJsonRequest; - httpRequest.body = requestContent; - httpRequest.headers['Content-Length'] = Buffer.isBuffer(requestContent) ? requestContent.length : Buffer.byteLength(requestContent, 'UTF8'); - // Send Request - return this.client.pipeline(httpRequest, function (err, response, body) { - if (err !== null && err !== undefined) { - return callback(err); - } - var statusCode = response.statusCode; - if (statusCode >= 400) { - var error = new Error(body); - error.statusCode = response.statusCode; - return callback(error); - } - - // Create Result - var result = null; - // Deserialize Response - var responseContent = body; - result = {}; - result.keyOpResponse = responseContent; - - result.statusCode = statusCode; - - return callback(null, result); - }); - }; - - /** - * Wraps a symmetric key using the specified key - * - * @param {string} keyIdentifier - * - * @param {KeyOpRequestMessageWithRawJsonContent} keyOpRequest - * - * @param {string} [keyOpRequest.rawJsonRequest] - * - * @param {function} callback - * - * @returns {Stream} The response stream. - */ - KeyOperations.prototype.wrapKey = function(keyIdentifier, keyOpRequest, callback) { - if (callback === null || callback === undefined) { - throw new Error('callback cannot be null.'); - } - // Validate - if (keyIdentifier === null || keyIdentifier === undefined) { - return callback(new Error('keyIdentifier cannot be null.')); - } - if (keyOpRequest === null || keyOpRequest === undefined) { - return callback(new Error('keyOpRequest cannot be null.')); - } - - // Tracing - - // Construct URL - var url2 = ''; - url2 = url2 + keyIdentifier; - url2 = url2 + '/wrapkey'; - var queryParameters = []; - queryParameters.push(API_VERSION_QUERY_PARAM); - if (queryParameters.length > 0) { - url2 = url2 + '?' + queryParameters.join('&'); - } - url2 = url2.replace(' ', '%20'); - - // Create HTTP transport objects - var httpRequest = new WebResource(); - httpRequest.method = 'POST'; - httpRequest.headers = {}; - httpRequest.url = url2; - - // Set Headers - httpRequest.headers['client-request-id'] = uuid(); - httpRequest.headers['Content-Type'] = 'application/json'; - - // Serialize Request - var requestContent = keyOpRequest.rawJsonRequest; - httpRequest.body = requestContent; - httpRequest.headers['Content-Length'] = Buffer.isBuffer(requestContent) ? requestContent.length : Buffer.byteLength(requestContent, 'UTF8'); - // Send Request - return this.client.pipeline(httpRequest, function (err, response, body) { - if (err !== null && err !== undefined) { - return callback(err); - } - var statusCode = response.statusCode; - if (statusCode >= 400) { - var error = new Error(body); - error.statusCode = response.statusCode; - return callback(error); - } - - // Create Result - var result = null; - // Deserialize Response - var responseContent = body; - result = {}; - result.keyOpResponse = responseContent; - - result.statusCode = statusCode; - - return callback(null, result); - }); - }; - - return KeyOperations; -})(); - -var SecretOperations = ( /** @lends SecretOperations */ function() { - /* (jsdoc off) - * @class - * Operations for secrets in a vault - * __NOTE__: An instance of this class is automatically created for an - * instance of the [KeyVaultInternalClient] {@link - * KeyVaultInternalClient~KeyVaultInternalClient}. - * See [secrets] {@link - * KeyVaultInternalClient~KeyVaultInternalClient#secrets}. - * Initializes a new instance of the SecretOperations class. - * @constructor - * - * @param {KeyVaultInternalClient} client Reference to the service client. - */ - function SecretOperations(client) { - this.client = client; - } - - /** - * Delete the specified secret - * - * @param {string} secretIdentifier - * - * @param {function} callback - * - * @returns {Stream} The response stream. - */ - SecretOperations.prototype.deleteMethod = function(secretIdentifier, callback) { - if (callback === null || callback === undefined) { - throw new Error('callback cannot be null.'); - } - // Validate - if (secretIdentifier === null || secretIdentifier === undefined) { - return callback(new Error('secretIdentifier cannot be null.')); - } - - // Tracing - - // Construct URL - var url2 = ''; - url2 = url2 + secretIdentifier; - var queryParameters = []; - queryParameters.push(API_VERSION_QUERY_PARAM); - if (queryParameters.length > 0) { - url2 = url2 + '?' + queryParameters.join('&'); - } - url2 = url2.replace(' ', '%20'); - - // Create HTTP transport objects - var httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; - httpRequest.headers = {}; - httpRequest.url = url2; - - // Set Headers - httpRequest.headers['Accept'] = 'application/json'; - httpRequest.headers['client-request-id'] = uuid(); - httpRequest.headers['Content-Type'] = 'application/json'; - - // Send Request - return this.client.pipeline(httpRequest, function (err, response, body) { - if (err !== null && err !== undefined) { - return callback(err); - } - var statusCode = response.statusCode; - if (statusCode >= 400) { - var error = new Error(body); - error.statusCode = response.statusCode; - return callback(error); - } - - // Create Result - var result = null; - // Deserialize Response - var responseContent = body; - result = {}; - result.response = responseContent; - - result.statusCode = statusCode; - - return callback(null, result); - }); - }; - - /** - * Gets a secret - * - * @param {string} secretIdentifier - * - * @param {function} callback - * - * @returns {Stream} The response stream. - */ - SecretOperations.prototype.get = function(secretIdentifier, callback) { - if (callback === null || callback === undefined) { - throw new Error('callback cannot be null.'); - } - // Validate - if (secretIdentifier === null || secretIdentifier === undefined) { - return callback(new Error('secretIdentifier cannot be null.')); - } - - // Tracing - - // Construct URL - var url2 = ''; - url2 = url2 + secretIdentifier; - var queryParameters = []; - queryParameters.push(API_VERSION_QUERY_PARAM); - if (queryParameters.length > 0) { - url2 = url2 + '?' + queryParameters.join('&'); - } - url2 = url2.replace(' ', '%20'); - - // Create HTTP transport objects - var httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.headers = {}; - httpRequest.url = url2; - - // Set Headers - httpRequest.headers['Accept'] = 'application/json'; - httpRequest.headers['client-request-id'] = uuid(); - httpRequest.headers['Content-Type'] = 'application/json'; - - // Send Request - return this.client.pipeline(httpRequest, function (err, response, body) { - if (err !== null && err !== undefined) { - return callback(err); - } - var statusCode = response.statusCode; - if (statusCode >= 400) { - var error = new Error(body); - error.statusCode = response.statusCode; - return callback(error); - } - - // Create Result - var result = null; - // Deserialize Response - var responseContent = body; - result = {}; - result.response = responseContent; - - result.statusCode = statusCode; - - return callback(null, result); - }); - }; - - /** - * List the secrets in the specified vault - * - * @param {string} vault - * - * @param {Number} [top] - * - * @param {function} callback - * - * @returns {Stream} The response stream. - */ - SecretOperations.prototype.list = function(vault, top, callback) { - if (callback === null || callback === undefined) { - throw new Error('callback cannot be null.'); - } - // Validate - if (vault === null || vault === undefined) { - return callback(new Error('vault cannot be null.')); - } - - // Tracing - - // Construct URL - var url2 = ''; - url2 = url2 + vault; - url2 = url2 + '/secrets/'; - var queryParameters = []; - queryParameters.push(API_VERSION_QUERY_PARAM); - if (top !== null && top !== undefined) { - queryParameters.push('maxresults=' + encodeURIComponent(top.toString())); - } - if (queryParameters.length > 0) { - url2 = url2 + '?' + queryParameters.join('&'); - } - url2 = url2.replace(' ', '%20'); - - // Create HTTP transport objects - var httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.headers = {}; - httpRequest.url = url2; - - // Set Headers - httpRequest.headers['Accept'] = 'application/json'; - httpRequest.headers['client-request-id'] = uuid(); - - // Send Request - return this.client.pipeline(httpRequest, function (err, response, body) { - if (err !== null && err !== undefined) { - return callback(err); - } - var statusCode = response.statusCode; - if (statusCode >= 400) { - var error = new Error(body); - error.statusCode = response.statusCode; - return callback(error); - } - - // Create Result - var result = null; - // Deserialize Response - var responseContent = body; - result = {}; - result.response = responseContent; - - result.statusCode = statusCode; - - return callback(null, result); - }); - }; - - /** - * List the next page of secrets in the specified vault - * - * @param {string} nextLink - * - * @param {function} callback - * - * @returns {Stream} The response stream. - */ - SecretOperations.prototype.listNext = function(nextLink, callback) { - if (callback === null || callback === undefined) { - throw new Error('callback cannot be null.'); - } - // Validate - if (nextLink === null || nextLink === undefined) { - return callback(new Error('nextLink cannot be null.')); - } - - // Tracing - - // Construct URL - var url2 = ''; - url2 = url2 + nextLink; - url2 = url2.replace(' ', '%20'); - - // Create HTTP transport objects - var httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.headers = {}; - httpRequest.url = url2; - - // Set Headers - httpRequest.headers['Accept'] = 'application/json'; - httpRequest.headers['client-request-id'] = uuid(); - - // Send Request - return this.client.pipeline(httpRequest, function (err, response, body) { - if (err !== null && err !== undefined) { - return callback(err); - } - var statusCode = response.statusCode; - if (statusCode >= 400) { - var error = new Error(body); - error.statusCode = response.statusCode; - return callback(error); - } - - // Create Result - var result = null; - // Deserialize Response - var responseContent = body; - result = {}; - result.response = responseContent; - - result.statusCode = statusCode; - - return callback(null, result); - }); - }; - - /** - * List the versions of a secret in the specified vault - * - * @param {string} vault - * - * @param {string} secretName - * - * @param {Number} [top] - * - * @param {function} callback - * - * @returns {Stream} The response stream. - */ - SecretOperations.prototype.listVersions = function(vault, secretName, top, callback) { - if (callback === null || callback === undefined) { - throw new Error('callback cannot be null.'); - } - // Validate - if (vault === null || vault === undefined) { - return callback(new Error('vault cannot be null.')); - } - if (secretName === null || secretName === undefined) { - return callback(new Error('secretName cannot be null.')); - } - - // Tracing - - // Construct URL - var url2 = ''; - url2 = url2 + vault; - url2 = url2 + '/secrets/'; - url2 = url2 + encodeURIComponent(secretName); - url2 = url2 + '/versions'; - var queryParameters = []; - queryParameters.push(API_VERSION_QUERY_PARAM); - if (top !== null && top !== undefined) { - queryParameters.push('maxresults=' + encodeURIComponent(top.toString())); - } - if (queryParameters.length > 0) { - url2 = url2 + '?' + queryParameters.join('&'); - } - url2 = url2.replace(' ', '%20'); - - // Create HTTP transport objects - var httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.headers = {}; - httpRequest.url = url2; - - // Set Headers - httpRequest.headers['Accept'] = 'application/json'; - httpRequest.headers['client-request-id'] = uuid(); - - // Send Request - return this.client.pipeline(httpRequest, function (err, response, body) { - if (err !== null && err !== undefined) { - return callback(err); - } - var statusCode = response.statusCode; - if (statusCode >= 400) { - var error = new Error(body); - error.statusCode = response.statusCode; - return callback(error); - } - - // Create Result - var result = null; - // Deserialize Response - var responseContent = body; - result = {}; - result.response = responseContent; - - result.statusCode = statusCode; - - return callback(null, result); - }); - }; - - /** - * List the versions of a secret in the specified vault - * - * @param {string} nextLink - * - * @param {function} callback - * - * @returns {Stream} The response stream. - */ - SecretOperations.prototype.listVersionsNext = function(nextLink, callback) { - if (callback === null || callback === undefined) { - throw new Error('callback cannot be null.'); - } - // Validate - if (nextLink === null || nextLink === undefined) { - return callback(new Error('nextLink cannot be null.')); - } - - // Tracing - - // Construct URL - var url2 = ''; - url2 = url2 + nextLink; - url2 = url2.replace(' ', '%20'); - - // Create HTTP transport objects - var httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.headers = {}; - httpRequest.url = url2; - - // Set Headers - httpRequest.headers['Accept'] = 'application/json'; - httpRequest.headers['client-request-id'] = uuid(); - - // Send Request - return this.client.pipeline(httpRequest, function (err, response, body) { - if (err !== null && err !== undefined) { - return callback(err); - } - var statusCode = response.statusCode; - if (statusCode >= 400) { - var error = new Error(body); - error.statusCode = response.statusCode; - return callback(error); - } - - // Create Result - var result = null; - // Deserialize Response - var responseContent = body; - result = {}; - result.response = responseContent; - - result.statusCode = statusCode; - - return callback(null, result); - }); - }; - - /** - * Sets a secret in the specified vault. - * - * @param {string} secretIdentifier - * - * @param {SecretRequestMessageWithRawJsonContent} request - * - * @param {string} [request.rawJsonRequest] - * - * @param {function} callback - * - * @returns {Stream} The response stream. - */ - SecretOperations.prototype.set = function(secretIdentifier, request, callback) { - if (callback === null || callback === undefined) { - throw new Error('callback cannot be null.'); - } - // Validate - if (secretIdentifier === null || secretIdentifier === undefined) { - return callback(new Error('secretIdentifier cannot be null.')); - } - if (request === null || request === undefined) { - return callback(new Error('request cannot be null.')); - } - - // Tracing - - // Construct URL - var url2 = ''; - url2 = url2 + secretIdentifier; - var queryParameters = []; - queryParameters.push(API_VERSION_QUERY_PARAM); - if (queryParameters.length > 0) { - url2 = url2 + '?' + queryParameters.join('&'); - } - url2 = url2.replace(' ', '%20'); - - // Create HTTP transport objects - var httpRequest = new WebResource(); - httpRequest.method = 'PUT'; - httpRequest.headers = {}; - httpRequest.url = url2; - - // Set Headers - httpRequest.headers['Accept'] = 'application/json'; - httpRequest.headers['client-request-id'] = uuid(); - httpRequest.headers['Content-Type'] = 'application/json'; - - // Serialize Request - var requestContent = request.rawJsonRequest; - httpRequest.body = requestContent; - httpRequest.headers['Content-Length'] = Buffer.isBuffer(requestContent) ? requestContent.length : Buffer.byteLength(requestContent, 'UTF8'); - // Send Request - return this.client.pipeline(httpRequest, function (err, response, body) { - if (err !== null && err !== undefined) { - return callback(err); - } - var statusCode = response.statusCode; - if (statusCode >= 400) { - var error = new Error(body); - error.statusCode = response.statusCode; - return callback(error); - } - - // Create Result - var result = null; - // Deserialize Response - var responseContent = body; - result = {}; - result.response = responseContent; - - result.statusCode = statusCode; - - return callback(null, result); - }); - }; - - /** - * Update the specified secret - * - * @param {string} secretIdentifier - * - * @param {SecretRequestMessageWithRawJsonContent} request - * - * @param {string} [request.rawJsonRequest] - * - * @param {function} callback - * - * @returns {Stream} The response stream. - */ - SecretOperations.prototype.update = function(secretIdentifier, request, callback) { - if (callback === null || callback === undefined) { - throw new Error('callback cannot be null.'); - } - // Validate - if (secretIdentifier === null || secretIdentifier === undefined) { - return callback(new Error('secretIdentifier cannot be null.')); - } - if (request === null || request === undefined) { - return callback(new Error('request cannot be null.')); - } - - // Tracing - - // Construct URL - var url2 = ''; - url2 = url2 + secretIdentifier; - var queryParameters = []; - queryParameters.push(API_VERSION_QUERY_PARAM); - if (queryParameters.length > 0) { - url2 = url2 + '?' + queryParameters.join('&'); - } - url2 = url2.replace(' ', '%20'); - - // Create HTTP transport objects - var httpRequest = new WebResource(); - httpRequest.method = 'PATCH'; - httpRequest.headers = {}; - httpRequest.url = url2; - - // Set Headers - httpRequest.headers['Accept'] = 'application/json'; - httpRequest.headers['client-request-id'] = uuid(); - httpRequest.headers['Content-Type'] = 'application/json'; - - // Serialize Request - var requestContent = request.rawJsonRequest; - httpRequest.body = requestContent; - httpRequest.headers['Content-Length'] = Buffer.isBuffer(requestContent) ? requestContent.length : Buffer.byteLength(requestContent, 'UTF8'); - // Send Request - return this.client.pipeline(httpRequest, function (err, response, body) { - if (err !== null && err !== undefined) { - return callback(err); - } - var statusCode = response.statusCode; - if (statusCode >= 400) { - var error = new Error(body); - error.statusCode = response.statusCode; - return callback(error); - } - - // Create Result - var result = null; - // Deserialize Response - var responseContent = body; - result = {}; - result.response = responseContent; - - result.statusCode = statusCode; - - return callback(null, result); - }); - }; - - return SecretOperations; -})(); diff --git a/lib/services/keyVault/lib/models/action.js b/lib/services/keyVault/lib/models/action.js new file mode 100644 index 000000000..ef9d4a96f --- /dev/null +++ b/lib/services/keyVault/lib/models/action.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * @class + * Initializes a new instance of the Action class. + * @constructor + * The action that will be executed. + * + * @member {string} [actionType] The type of the action. Possible values + * include: 'EmailContacts', 'AutoRenew' + * + */ +function Action() { +} + +/** + * Defines the metadata of Action + * + * @returns {object} metadata of Action + * + */ +Action.prototype.mapper = function () { + return { + required: false, + serializedName: 'Action', + type: { + name: 'Composite', + className: 'Action', + modelProperties: { + actionType: { + required: false, + serializedName: 'action_type', + type: { + name: 'Enum', + allowedValues: [ 'EmailContacts', 'AutoRenew' ] + } + } + } + } + }; +}; + +module.exports = Action; diff --git a/lib/services/keyVault/lib/models/administratorDetails.js b/lib/services/keyVault/lib/models/administratorDetails.js new file mode 100644 index 000000000..02bfb4da5 --- /dev/null +++ b/lib/services/keyVault/lib/models/administratorDetails.js @@ -0,0 +1,78 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * @class + * Initializes a new instance of the AdministratorDetails class. + * @constructor + * Details of the organization administrator of the certificate issuer + * + * @member {string} [firstName] First name. + * + * @member {string} [lastName] Last name. + * + * @member {string} [emailAddress] Email addresss. + * + * @member {string} [phone] Phone number. + * + */ +function AdministratorDetails() { +} + +/** + * Defines the metadata of AdministratorDetails + * + * @returns {object} metadata of AdministratorDetails + * + */ +AdministratorDetails.prototype.mapper = function () { + return { + required: false, + serializedName: 'AdministratorDetails', + type: { + name: 'Composite', + className: 'AdministratorDetails', + modelProperties: { + firstName: { + required: false, + serializedName: 'first_name', + type: { + name: 'String' + } + }, + lastName: { + required: false, + serializedName: 'last_name', + type: { + name: 'String' + } + }, + emailAddress: { + required: false, + serializedName: 'email', + type: { + name: 'String' + } + }, + phone: { + required: false, + serializedName: 'phone', + type: { + name: 'String' + } + } + } + } + }; +}; + +module.exports = AdministratorDetails; diff --git a/lib/services/keyVault/lib/models/attributes.js b/lib/services/keyVault/lib/models/attributes.js new file mode 100644 index 000000000..d5d65c2cd --- /dev/null +++ b/lib/services/keyVault/lib/models/attributes.js @@ -0,0 +1,89 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * @class + * Initializes a new instance of the Attributes class. + * @constructor + * The object attributes managed by the KeyVault service + * + * @member {boolean} [enabled] Determines whether the object is enabled + * + * @member {date} [notBefore] Not before date in UTC + * + * @member {date} [expires] Expiry date in UTC + * + * @member {date} [created] Creation time in UTC + * + * @member {date} [updated] Last updated time in UTC + * + */ +function Attributes() { +} + +/** + * Defines the metadata of Attributes + * + * @returns {object} metadata of Attributes + * + */ +Attributes.prototype.mapper = function () { + return { + required: false, + serializedName: 'Attributes', + type: { + name: 'Composite', + className: 'Attributes', + modelProperties: { + enabled: { + required: false, + serializedName: 'enabled', + type: { + name: 'Boolean' + } + }, + notBefore: { + required: false, + serializedName: 'nbf', + type: { + name: 'UnixTime' + } + }, + expires: { + required: false, + serializedName: 'exp', + type: { + name: 'UnixTime' + } + }, + created: { + required: false, + readOnly: true, + serializedName: 'created', + type: { + name: 'UnixTime' + } + }, + updated: { + required: false, + readOnly: true, + serializedName: 'updated', + type: { + name: 'UnixTime' + } + } + } + } + }; +}; + +module.exports = Attributes; diff --git a/lib/services/keyVault/lib/models/backupKeyResult.js b/lib/services/keyVault/lib/models/backupKeyResult.js new file mode 100644 index 000000000..035bfabf0 --- /dev/null +++ b/lib/services/keyVault/lib/models/backupKeyResult.js @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * @class + * Initializes a new instance of the BackupKeyResult class. + * @constructor + * The backup key result, containing the backup blob + * + * @member {buffer} [value] The backup blob containing the backed up key + * + */ +function BackupKeyResult() { +} + +/** + * Defines the metadata of BackupKeyResult + * + * @returns {object} metadata of BackupKeyResult + * + */ +BackupKeyResult.prototype.mapper = function () { + return { + required: false, + serializedName: 'BackupKeyResult', + type: { + name: 'Composite', + className: 'BackupKeyResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: 'value', + type: { + name: 'Base64Url' + } + } + } + } + }; +}; + +module.exports = BackupKeyResult; diff --git a/lib/services/keyVault/lib/models/certificateAttributes.js b/lib/services/keyVault/lib/models/certificateAttributes.js new file mode 100644 index 000000000..95a76b450 --- /dev/null +++ b/lib/services/keyVault/lib/models/certificateAttributes.js @@ -0,0 +1,86 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var models = require('./index'); + +var util = require('util'); + +/** + * @class + * Initializes a new instance of the CertificateAttributes class. + * @constructor + * The certificate management attributes + * + */ +function CertificateAttributes() { + CertificateAttributes['super_'].call(this); +} + +util.inherits(CertificateAttributes, models['Attributes']); + +/** + * Defines the metadata of CertificateAttributes + * + * @returns {object} metadata of CertificateAttributes + * + */ +CertificateAttributes.prototype.mapper = function () { + return { + required: false, + serializedName: 'CertificateAttributes', + type: { + name: 'Composite', + className: 'CertificateAttributes', + modelProperties: { + enabled: { + required: false, + serializedName: 'enabled', + type: { + name: 'Boolean' + } + }, + notBefore: { + required: false, + serializedName: 'nbf', + type: { + name: 'UnixTime' + } + }, + expires: { + required: false, + serializedName: 'exp', + type: { + name: 'UnixTime' + } + }, + created: { + required: false, + readOnly: true, + serializedName: 'created', + type: { + name: 'UnixTime' + } + }, + updated: { + required: false, + readOnly: true, + serializedName: 'updated', + type: { + name: 'UnixTime' + } + } + } + } + }; +}; + +module.exports = CertificateAttributes; diff --git a/lib/services/keyVault/lib/models/certificateBundle.js b/lib/services/keyVault/lib/models/certificateBundle.js new file mode 100644 index 000000000..96179099f --- /dev/null +++ b/lib/services/keyVault/lib/models/certificateBundle.js @@ -0,0 +1,203 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var models = require('./index'); + +/** + * @class + * Initializes a new instance of the CertificateBundle class. + * @constructor + * A certificate bundle consists of a certificate (X509) plus its attributes. + * + * @member {string} [id] The certificate id + * + * @member {string} [kid] The key id + * + * @member {string} [sid] The secret id + * + * @member {buffer} [x509Thumbprint] Thumbprint of the certificate. + * + * @member {object} [policy] The management policy. + * + * @member {string} [policy.id] The certificate id + * + * @member {object} [policy.keyProperties] Properties of the key backing a + * certificate. + * + * @member {boolean} [policy.keyProperties.exportable] Indicates if the + * private key can be exported. + * + * @member {string} [policy.keyProperties.keyType] The key type. + * + * @member {number} [policy.keyProperties.keySize] The key size in bytes. e.g. + * 1024 or 2048. + * + * @member {boolean} [policy.keyProperties.reuseKey] Indicates if the same key + * pair will be used on certificate renewal. + * + * @member {object} [policy.secretProperties] Properties of the secret backing + * a certificate. + * + * @member {string} [policy.secretProperties.contentType] The media type (MIME + * type). + * + * @member {object} [policy.x509CertificateProperties] Properties of the X509 + * component of a certificate. + * + * @member {string} [policy.x509CertificateProperties.subject] The subject + * name. Should be a valid X509 Distinguished Name. + * + * @member {array} [policy.x509CertificateProperties.ekus] The enhaunced key + * usage. + * + * @member {object} [policy.x509CertificateProperties.subjectAlternativeNames] + * The subject alternative names. + * + * @member {array} + * [policy.x509CertificateProperties.subjectAlternativeNames.emails] Email + * addresses. + * + * @member {array} + * [policy.x509CertificateProperties.subjectAlternativeNames.dnsNames] Domain + * names. + * + * @member {array} + * [policy.x509CertificateProperties.subjectAlternativeNames.upns] User + * principal names. + * + * @member {array} [policy.x509CertificateProperties.keyUsage] List of key + * usages. + * + * @member {number} [policy.x509CertificateProperties.validityInMonths] The + * subject alternate names. + * + * @member {array} [policy.lifetimeActions] Actions that will be performed by + * Key Vault over the lifetime of a certificate. + * + * @member {object} [policy.issuerReference] Reference to the issuer of the + * X509 component of a certificate. + * + * @member {string} [policy.issuerReference.name] Name of the referenced + * issuer object. + * + * @member {object} [policy.attributes] The certificate attributes. + * + * @member {buffer} [cer] CER contents of x509 certificate. + * + * @member {string} [contentType] The content type of the secret + * + * @member {object} [attributes] The certificate attributes. + * + * @member {object} [tags] Application-specific metadata in the form of + * key-value pairs + * + */ +function CertificateBundle() { +} + +/** + * Defines the metadata of CertificateBundle + * + * @returns {object} metadata of CertificateBundle + * + */ +CertificateBundle.prototype.mapper = function () { + return { + required: false, + serializedName: 'CertificateBundle', + type: { + name: 'Composite', + className: 'CertificateBundle', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + kid: { + required: false, + readOnly: true, + serializedName: 'kid', + type: { + name: 'String' + } + }, + sid: { + required: false, + readOnly: true, + serializedName: 'sid', + type: { + name: 'String' + } + }, + x509Thumbprint: { + required: false, + readOnly: true, + serializedName: 'x5t', + type: { + name: 'Base64Url' + } + }, + policy: { + required: false, + readOnly: true, + serializedName: 'policy', + type: { + name: 'Composite', + className: 'CertificatePolicy' + } + }, + cer: { + required: false, + serializedName: 'cer', + type: { + name: 'ByteArray' + } + }, + contentType: { + required: false, + serializedName: 'contentType', + type: { + name: 'String' + } + }, + attributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'CertificateAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; +}; + +module.exports = CertificateBundle; diff --git a/lib/services/keyVault/lib/models/certificateCreateParameters.js b/lib/services/keyVault/lib/models/certificateCreateParameters.js new file mode 100644 index 000000000..517f9a5d8 --- /dev/null +++ b/lib/services/keyVault/lib/models/certificateCreateParameters.js @@ -0,0 +1,148 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var models = require('./index'); + +/** + * @class + * Initializes a new instance of the CertificateCreateParameters class. + * @constructor + * The certificate create parameters + * + * @member {object} [certificatePolicy] The management policy for the + * certificate + * + * @member {string} [certificatePolicy.id] The certificate id + * + * @member {object} [certificatePolicy.keyProperties] Properties of the key + * backing a certificate. + * + * @member {boolean} [certificatePolicy.keyProperties.exportable] Indicates if + * the private key can be exported. + * + * @member {string} [certificatePolicy.keyProperties.keyType] The key type. + * + * @member {number} [certificatePolicy.keyProperties.keySize] The key size in + * bytes. e.g. 1024 or 2048. + * + * @member {boolean} [certificatePolicy.keyProperties.reuseKey] Indicates if + * the same key pair will be used on certificate renewal. + * + * @member {object} [certificatePolicy.secretProperties] Properties of the + * secret backing a certificate. + * + * @member {string} [certificatePolicy.secretProperties.contentType] The media + * type (MIME type). + * + * @member {object} [certificatePolicy.x509CertificateProperties] Properties + * of the X509 component of a certificate. + * + * @member {string} [certificatePolicy.x509CertificateProperties.subject] The + * subject name. Should be a valid X509 Distinguished Name. + * + * @member {array} [certificatePolicy.x509CertificateProperties.ekus] The + * enhaunced key usage. + * + * @member {object} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames] The + * subject alternative names. + * + * @member {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @member {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * + * @member {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @member {array} [certificatePolicy.x509CertificateProperties.keyUsage] List + * of key usages. + * + * @member {number} + * [certificatePolicy.x509CertificateProperties.validityInMonths] The subject + * alternate names. + * + * @member {array} [certificatePolicy.lifetimeActions] Actions that will be + * performed by Key Vault over the lifetime of a certificate. + * + * @member {object} [certificatePolicy.issuerReference] Reference to the + * issuer of the X509 component of a certificate. + * + * @member {string} [certificatePolicy.issuerReference.name] Name of the + * referenced issuer object. + * + * @member {object} [certificatePolicy.attributes] The certificate attributes. + * + * @member {object} [certificateAttributes] The attributes of the certificate + * (optional) + * + * @member {object} [tags] Application-specific metadata in the form of + * key-value pairs + * + */ +function CertificateCreateParameters() { +} + +/** + * Defines the metadata of CertificateCreateParameters + * + * @returns {object} metadata of CertificateCreateParameters + * + */ +CertificateCreateParameters.prototype.mapper = function () { + return { + required: false, + serializedName: 'CertificateCreateParameters', + type: { + name: 'Composite', + className: 'CertificateCreateParameters', + modelProperties: { + certificatePolicy: { + required: false, + serializedName: 'policy', + type: { + name: 'Composite', + className: 'CertificatePolicy' + } + }, + certificateAttributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'CertificateAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; +}; + +module.exports = CertificateCreateParameters; diff --git a/lib/services/keyVault/lib/models/certificateImportParameters.js b/lib/services/keyVault/lib/models/certificateImportParameters.js new file mode 100644 index 000000000..8a58e61cf --- /dev/null +++ b/lib/services/keyVault/lib/models/certificateImportParameters.js @@ -0,0 +1,169 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var models = require('./index'); + +/** + * @class + * Initializes a new instance of the CertificateImportParameters class. + * @constructor + * The certificate import parameters + * + * @member {string} base64EncodedCertificate Base64 encoded representation of + * the certificate object to import. This certificate needs to contain the + * private key. + * + * @member {string} [password] If the private key in base64EncodedCertificate + * is encrypted, the password used for encryption + * + * @member {object} [certificatePolicy] The management policy for the + * certificate + * + * @member {string} [certificatePolicy.id] The certificate id + * + * @member {object} [certificatePolicy.keyProperties] Properties of the key + * backing a certificate. + * + * @member {boolean} [certificatePolicy.keyProperties.exportable] Indicates if + * the private key can be exported. + * + * @member {string} [certificatePolicy.keyProperties.keyType] The key type. + * + * @member {number} [certificatePolicy.keyProperties.keySize] The key size in + * bytes. e.g. 1024 or 2048. + * + * @member {boolean} [certificatePolicy.keyProperties.reuseKey] Indicates if + * the same key pair will be used on certificate renewal. + * + * @member {object} [certificatePolicy.secretProperties] Properties of the + * secret backing a certificate. + * + * @member {string} [certificatePolicy.secretProperties.contentType] The media + * type (MIME type). + * + * @member {object} [certificatePolicy.x509CertificateProperties] Properties + * of the X509 component of a certificate. + * + * @member {string} [certificatePolicy.x509CertificateProperties.subject] The + * subject name. Should be a valid X509 Distinguished Name. + * + * @member {array} [certificatePolicy.x509CertificateProperties.ekus] The + * enhaunced key usage. + * + * @member {object} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames] The + * subject alternative names. + * + * @member {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @member {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * + * @member {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @member {array} [certificatePolicy.x509CertificateProperties.keyUsage] List + * of key usages. + * + * @member {number} + * [certificatePolicy.x509CertificateProperties.validityInMonths] The subject + * alternate names. + * + * @member {array} [certificatePolicy.lifetimeActions] Actions that will be + * performed by Key Vault over the lifetime of a certificate. + * + * @member {object} [certificatePolicy.issuerReference] Reference to the + * issuer of the X509 component of a certificate. + * + * @member {string} [certificatePolicy.issuerReference.name] Name of the + * referenced issuer object. + * + * @member {object} [certificatePolicy.attributes] The certificate attributes. + * + * @member {object} [certificateAttributes] The attributes of the certificate + * (optional) + * + * @member {object} [tags] Application-specific metadata in the form of + * key-value pairs + * + */ +function CertificateImportParameters() { +} + +/** + * Defines the metadata of CertificateImportParameters + * + * @returns {object} metadata of CertificateImportParameters + * + */ +CertificateImportParameters.prototype.mapper = function () { + return { + required: false, + serializedName: 'CertificateImportParameters', + type: { + name: 'Composite', + className: 'CertificateImportParameters', + modelProperties: { + base64EncodedCertificate: { + required: true, + serializedName: 'value', + type: { + name: 'String' + } + }, + password: { + required: false, + serializedName: 'pwd', + type: { + name: 'String' + } + }, + certificatePolicy: { + required: false, + serializedName: 'policy', + type: { + name: 'Composite', + className: 'CertificatePolicy' + } + }, + certificateAttributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'CertificateAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; +}; + +module.exports = CertificateImportParameters; diff --git a/lib/services/keyVault/lib/models/certificateIssuerItem.js b/lib/services/keyVault/lib/models/certificateIssuerItem.js new file mode 100644 index 000000000..fd713a6eb --- /dev/null +++ b/lib/services/keyVault/lib/models/certificateIssuerItem.js @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * @class + * Initializes a new instance of the CertificateIssuerItem class. + * @constructor + * The certificate issuer item containing certificate issuer metadata + * + * @member {string} [id] Certificate Identifier + * + * @member {string} [provider] The name of the issuer. + * + */ +function CertificateIssuerItem() { +} + +/** + * Defines the metadata of CertificateIssuerItem + * + * @returns {object} metadata of CertificateIssuerItem + * + */ +CertificateIssuerItem.prototype.mapper = function () { + return { + required: false, + serializedName: 'CertificateIssuerItem', + type: { + name: 'Composite', + className: 'CertificateIssuerItem', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + provider: { + required: false, + serializedName: 'provider', + type: { + name: 'String' + } + } + } + } + }; +}; + +module.exports = CertificateIssuerItem; diff --git a/lib/services/keyVault/lib/models/certificateIssuerListResult.js b/lib/services/keyVault/lib/models/certificateIssuerListResult.js new file mode 100644 index 000000000..dd10a8e7c --- /dev/null +++ b/lib/services/keyVault/lib/models/certificateIssuerListResult.js @@ -0,0 +1,76 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var util = require('util'); + +/** + * @class + * Initializes a new instance of the CertificateIssuerListResult class. + * @constructor + * The certificate issuer list result + * @member {array} [value] A response message containing a list of certificate + * issuers in the vault along with a link to the next page of certificate + * issuers + * + * @member {string} [nextLink] The URL to get the next set of certificate + * issuers. + * + */ +function CertificateIssuerListResult() { +} + +util.inherits(CertificateIssuerListResult, Array); + +/** + * Defines the metadata of CertificateIssuerListResult + * + * @returns {object} metadata of CertificateIssuerListResult + * + */ +CertificateIssuerListResult.prototype.mapper = function () { + return { + required: false, + serializedName: 'CertificateIssuerListResult', + type: { + name: 'Composite', + className: 'CertificateIssuerListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CertificateIssuerItemElementType', + type: { + name: 'Composite', + className: 'CertificateIssuerItem' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; +}; + +module.exports = CertificateIssuerListResult; diff --git a/lib/services/keyVault/lib/models/certificateItem.js b/lib/services/keyVault/lib/models/certificateItem.js new file mode 100644 index 000000000..80fad1792 --- /dev/null +++ b/lib/services/keyVault/lib/models/certificateItem.js @@ -0,0 +1,89 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var models = require('./index'); + +/** + * @class + * Initializes a new instance of the CertificateItem class. + * @constructor + * The certificate item containing certificate metadata + * + * @member {string} [id] Certificate Identifier + * + * @member {object} [attributes] The certificate management attributes + * + * @member {object} [tags] Application-specific metadata in the form of + * key-value pairs + * + * @member {buffer} [x509Thumbprint] Thumbprint of the certificate. + * + */ +function CertificateItem() { +} + +/** + * Defines the metadata of CertificateItem + * + * @returns {object} metadata of CertificateItem + * + */ +CertificateItem.prototype.mapper = function () { + return { + required: false, + serializedName: 'CertificateItem', + type: { + name: 'Composite', + className: 'CertificateItem', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + attributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'CertificateAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + x509Thumbprint: { + required: false, + serializedName: 'x5t', + type: { + name: 'Base64Url' + } + } + } + } + }; +}; + +module.exports = CertificateItem; diff --git a/lib/services/keyVault/lib/models/certificateListResult.js b/lib/services/keyVault/lib/models/certificateListResult.js new file mode 100644 index 000000000..7f10e06a1 --- /dev/null +++ b/lib/services/keyVault/lib/models/certificateListResult.js @@ -0,0 +1,75 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var util = require('util'); + +/** + * @class + * Initializes a new instance of the CertificateListResult class. + * @constructor + * The certificate list result + * @member {array} [value] A response message containing a list of + * certificates in the vault along with a link to the next page of + * certificates + * + * @member {string} [nextLink] The URL to get the next set of certificates. + * + */ +function CertificateListResult() { +} + +util.inherits(CertificateListResult, Array); + +/** + * Defines the metadata of CertificateListResult + * + * @returns {object} metadata of CertificateListResult + * + */ +CertificateListResult.prototype.mapper = function () { + return { + required: false, + serializedName: 'CertificateListResult', + type: { + name: 'Composite', + className: 'CertificateListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CertificateItemElementType', + type: { + name: 'Composite', + className: 'CertificateItem' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; +}; + +module.exports = CertificateListResult; diff --git a/lib/services/keyVault/lib/models/certificateMergeParameters.js b/lib/services/keyVault/lib/models/certificateMergeParameters.js new file mode 100644 index 000000000..c1ede997e --- /dev/null +++ b/lib/services/keyVault/lib/models/certificateMergeParameters.js @@ -0,0 +1,91 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var models = require('./index'); + +var util = require('util'); + +/** + * @class + * Initializes a new instance of the CertificateMergeParameters class. + * @constructor + * The certificate merge parameters + * + * @member {array} x509Certificates The certificate or the certificate chain + * to merge + * + * @member {object} [certificateAttributes] The attributes of the certificate + * (optional) + * + * @member {object} [tags] Application-specific metadata in the form of + * key-value pairs + * + */ +function CertificateMergeParameters() { +} + +/** + * Defines the metadata of CertificateMergeParameters + * + * @returns {object} metadata of CertificateMergeParameters + * + */ +CertificateMergeParameters.prototype.mapper = function () { + return { + required: false, + serializedName: 'CertificateMergeParameters', + type: { + name: 'Composite', + className: 'CertificateMergeParameters', + modelProperties: { + x509Certificates: { + required: true, + serializedName: 'x5c', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'BufferElementType', + type: { + name: 'ByteArray' + } + } + } + }, + certificateAttributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'CertificateAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; +}; + +module.exports = CertificateMergeParameters; diff --git a/lib/services/keyVault/lib/models/certificateOperation.js b/lib/services/keyVault/lib/models/certificateOperation.js new file mode 100644 index 000000000..1de835dc0 --- /dev/null +++ b/lib/services/keyVault/lib/models/certificateOperation.js @@ -0,0 +1,141 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var models = require('./index'); + +/** + * @class + * Initializes a new instance of the CertificateOperation class. + * @constructor + * A certificate operation is returned in case of async requests. + * + * @member {string} [id] The certificate id + * + * @member {object} [issuerReference] Reference to the issuer of the X509 + * component of a certificate. + * + * @member {string} [issuerReference.name] Name of the referenced issuer + * object. + * + * @member {buffer} [csr] The Certificate Signing Request (CSR) that is being + * used in the certificate operation. + * + * @member {boolean} [cancellationRequested] Indicates if cancellation was + * requested on the certificate operation. + * + * @member {string} [status] Status of the certificate operation. + * + * @member {string} [statusDetails] The status details of the certificate + * operation. + * + * @member {object} [error] Error encountered, if any, during the certificate + * operation. + * + * @member {string} [error.code] The error code. + * + * @member {string} [error.message] The error message. + * + * @member {string} [target] Location which contains the result of the + * certificate operation. + * + * @member {string} [requestId] Identifier for the certificate operation. + * + */ +function CertificateOperation() { +} + +/** + * Defines the metadata of CertificateOperation + * + * @returns {object} metadata of CertificateOperation + * + */ +CertificateOperation.prototype.mapper = function () { + return { + required: false, + serializedName: 'CertificateOperation', + type: { + name: 'Composite', + className: 'CertificateOperation', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + issuerReference: { + required: false, + serializedName: 'issuer', + type: { + name: 'Composite', + className: 'IssuerReference' + } + }, + csr: { + required: false, + serializedName: 'csr', + type: { + name: 'ByteArray' + } + }, + cancellationRequested: { + required: false, + serializedName: 'cancellation_requested', + type: { + name: 'Boolean' + } + }, + status: { + required: false, + serializedName: 'status', + type: { + name: 'String' + } + }, + statusDetails: { + required: false, + serializedName: 'status_details', + type: { + name: 'String' + } + }, + error: { + required: false, + serializedName: 'error', + type: { + name: 'Composite', + className: 'ErrorModel' + } + }, + target: { + required: false, + serializedName: 'target', + type: { + name: 'String' + } + }, + requestId: { + required: false, + serializedName: 'request_id', + type: { + name: 'String' + } + } + } + } + }; +}; + +module.exports = CertificateOperation; diff --git a/lib/services/keyVault/lib/models/certificatePolicy.js b/lib/services/keyVault/lib/models/certificatePolicy.js new file mode 100644 index 000000000..c42cde586 --- /dev/null +++ b/lib/services/keyVault/lib/models/certificatePolicy.js @@ -0,0 +1,166 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var models = require('./index'); + +var util = require('util'); + +/** + * @class + * Initializes a new instance of the CertificatePolicy class. + * @constructor + * Management policy for a certificate. + * + * @member {string} [id] The certificate id + * + * @member {object} [keyProperties] Properties of the key backing a + * certificate. + * + * @member {boolean} [keyProperties.exportable] Indicates if the private key + * can be exported. + * + * @member {string} [keyProperties.keyType] The key type. + * + * @member {number} [keyProperties.keySize] The key size in bytes. e.g. 1024 + * or 2048. + * + * @member {boolean} [keyProperties.reuseKey] Indicates if the same key pair + * will be used on certificate renewal. + * + * @member {object} [secretProperties] Properties of the secret backing a + * certificate. + * + * @member {string} [secretProperties.contentType] The media type (MIME type). + * + * @member {object} [x509CertificateProperties] Properties of the X509 + * component of a certificate. + * + * @member {string} [x509CertificateProperties.subject] The subject name. + * Should be a valid X509 Distinguished Name. + * + * @member {array} [x509CertificateProperties.ekus] The enhaunced key usage. + * + * @member {object} [x509CertificateProperties.subjectAlternativeNames] The + * subject alternative names. + * + * @member {array} [x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @member {array} + * [x509CertificateProperties.subjectAlternativeNames.dnsNames] Domain names. + * + * @member {array} [x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @member {array} [x509CertificateProperties.keyUsage] List of key usages. + * + * @member {number} [x509CertificateProperties.validityInMonths] The subject + * alternate names. + * + * @member {array} [lifetimeActions] Actions that will be performed by Key + * Vault over the lifetime of a certificate. + * + * @member {object} [issuerReference] Reference to the issuer of the X509 + * component of a certificate. + * + * @member {string} [issuerReference.name] Name of the referenced issuer + * object. + * + * @member {object} [attributes] The certificate attributes. + * + */ +function CertificatePolicy() { +} + +/** + * Defines the metadata of CertificatePolicy + * + * @returns {object} metadata of CertificatePolicy + * + */ +CertificatePolicy.prototype.mapper = function () { + return { + required: false, + serializedName: 'CertificatePolicy', + type: { + name: 'Composite', + className: 'CertificatePolicy', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + keyProperties: { + required: false, + serializedName: 'key_props', + type: { + name: 'Composite', + className: 'KeyProperties' + } + }, + secretProperties: { + required: false, + serializedName: 'secret_props', + type: { + name: 'Composite', + className: 'SecretProperties' + } + }, + x509CertificateProperties: { + required: false, + serializedName: 'x509_props', + type: { + name: 'Composite', + className: 'X509CertificateProperties' + } + }, + lifetimeActions: { + required: false, + serializedName: 'lifetime_actions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'LifetimeActionElementType', + type: { + name: 'Composite', + className: 'LifetimeAction' + } + } + } + }, + issuerReference: { + required: false, + serializedName: 'issuer', + type: { + name: 'Composite', + className: 'IssuerReference' + } + }, + attributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'CertificateAttributes' + } + } + } + } + }; +}; + +module.exports = CertificatePolicy; diff --git a/lib/services/keyVault/lib/models/certificateUpdateParameters.js b/lib/services/keyVault/lib/models/certificateUpdateParameters.js new file mode 100644 index 000000000..760dab7e8 --- /dev/null +++ b/lib/services/keyVault/lib/models/certificateUpdateParameters.js @@ -0,0 +1,72 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var models = require('./index'); + +/** + * @class + * Initializes a new instance of the CertificateUpdateParameters class. + * @constructor + * The certificate update parameters + * + * @member {object} [certificateAttributes] The attributes of the certificate + * (optional) + * + * @member {object} [tags] Application-specific metadata in the form of + * key-value pairs + * + */ +function CertificateUpdateParameters() { +} + +/** + * Defines the metadata of CertificateUpdateParameters + * + * @returns {object} metadata of CertificateUpdateParameters + * + */ +CertificateUpdateParameters.prototype.mapper = function () { + return { + required: false, + serializedName: 'CertificateUpdateParameters', + type: { + name: 'Composite', + className: 'CertificateUpdateParameters', + modelProperties: { + certificateAttributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'CertificateAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; +}; + +module.exports = CertificateUpdateParameters; diff --git a/lib/services/keyVault/lib/models/contact.js b/lib/services/keyVault/lib/models/contact.js new file mode 100644 index 000000000..47f45ef45 --- /dev/null +++ b/lib/services/keyVault/lib/models/contact.js @@ -0,0 +1,69 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * @class + * Initializes a new instance of the Contact class. + * @constructor + * The contact information for the vault certificates. + * + * @member {string} [emailAddress] Email addresss. + * + * @member {string} [name] Name. + * + * @member {string} [phone] Phone number. + * + */ +function Contact() { +} + +/** + * Defines the metadata of Contact + * + * @returns {object} metadata of Contact + * + */ +Contact.prototype.mapper = function () { + return { + required: false, + serializedName: 'Contact', + type: { + name: 'Composite', + className: 'Contact', + modelProperties: { + emailAddress: { + required: false, + serializedName: 'email', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + phone: { + required: false, + serializedName: 'phone', + type: { + name: 'String' + } + } + } + } + }; +}; + +module.exports = Contact; diff --git a/lib/services/keyVault/lib/models/contacts.js b/lib/services/keyVault/lib/models/contacts.js new file mode 100644 index 000000000..63f40229e --- /dev/null +++ b/lib/services/keyVault/lib/models/contacts.js @@ -0,0 +1,73 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var models = require('./index'); + +var util = require('util'); + +/** + * @class + * Initializes a new instance of the Contacts class. + * @constructor + * The contacts for the vault certificates. + * + * @member {string} [id] Identifier for the contacts collection. + * + * @member {array} [contactList] The contact list for the vault certificates. + * + */ +function Contacts() { +} + +/** + * Defines the metadata of Contacts + * + * @returns {object} metadata of Contacts + * + */ +Contacts.prototype.mapper = function () { + return { + required: false, + serializedName: 'Contacts', + type: { + name: 'Composite', + className: 'Contacts', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + contactList: { + required: false, + serializedName: 'contacts', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ContactElementType', + type: { + name: 'Composite', + className: 'Contact' + } + } + } + } + } + } + }; +}; + +module.exports = Contacts; diff --git a/lib/services/keyVault/lib/models/errorModel.js b/lib/services/keyVault/lib/models/errorModel.js new file mode 100644 index 000000000..7b997b1bd --- /dev/null +++ b/lib/services/keyVault/lib/models/errorModel.js @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * @class + * Initializes a new instance of the ErrorModel class. + * @constructor + * The key vault server error + * + * @member {string} [code] The error code. + * + * @member {string} [message] The error message. + * + */ +function ErrorModel() { +} + +/** + * Defines the metadata of ErrorModel + * + * @returns {object} metadata of ErrorModel + * + */ +ErrorModel.prototype.mapper = function () { + return { + required: false, + serializedName: 'Error', + type: { + name: 'Composite', + className: 'ErrorModel', + modelProperties: { + code: { + required: false, + readOnly: true, + serializedName: 'code', + type: { + name: 'String' + } + }, + message: { + required: false, + readOnly: true, + serializedName: 'message', + type: { + name: 'String' + } + } + } + } + }; +}; + +module.exports = ErrorModel; diff --git a/lib/services/keyVault/lib/models/index.d.ts b/lib/services/keyVault/lib/models/index.d.ts new file mode 100644 index 000000000..c6dec20c3 --- /dev/null +++ b/lib/services/keyVault/lib/models/index.d.ts @@ -0,0 +1,1332 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. +// TODO: Include PageTemplateModels here too?? Probably + */ + + +/** + * @class + * Initializes a new instance of the Attributes class. + * @constructor + * The object attributes managed by the KeyVault service + * + * @member {boolean} [enabled] Determines whether the object is enabled + * + * @member {date} [notBefore] Not before date in UTC + * + * @member {date} [expires] Expiry date in UTC + * + * @member {date} [created] Creation time in UTC + * + * @member {date} [updated] Last updated time in UTC + * + */ +export interface Attributes { + enabled?: boolean; + notBefore?: Date; + expires?: Date; + created?: Date; + updated?: Date; +} + +/** + * @class + * Initializes a new instance of the JsonWebKey class. + * @constructor + * As of http://tools.ietf.org/html/draft-ietf-jose-json-web-key-18 + * + * @member {string} [kid] Key Identifier + * + * @member {string} [kty] Key type, usually RSA. Possible values include: + * 'EC', 'RSA', 'RSA-HSM', 'oct' + * + * @member {array} [keyOps] + * + * @member {buffer} [n] RSA modulus + * + * @member {buffer} [e] RSA public exponent + * + * @member {buffer} [d] RSA private exponent + * + * @member {buffer} [dp] RSA Private Key Parameter + * + * @member {buffer} [dq] RSA Private Key Parameter + * + * @member {buffer} [qi] RSA Private Key Parameter + * + * @member {buffer} [p] RSA secret prime + * + * @member {buffer} [q] RSA secret prime, with p < q + * + * @member {buffer} [k] Symmetric key + * + * @member {buffer} [t] HSM Token, used with Bring Your Own Key + * + */ +export interface JsonWebKey { + kid?: string; + kty?: string; + keyOps?: string[]; + n?: Buffer; + e?: Buffer; + d?: Buffer; + dp?: Buffer; + dq?: Buffer; + qi?: Buffer; + p?: Buffer; + q?: Buffer; + k?: Buffer; + t?: Buffer; +} + +/** + * @class + * Initializes a new instance of the KeyAttributes class. + * @constructor + * The attributes of a key managed by the KeyVault service + * + */ +export interface KeyAttributes extends Attributes { +} + +/** + * @class + * Initializes a new instance of the KeyBundle class. + * @constructor + * A KeyBundle consisting of a WebKey plus its Attributes + * + * @member {object} [key] The Json web key + * + * @member {string} [key.kid] Key Identifier + * + * @member {string} [key.kty] Key type, usually RSA. Possible values include: + * 'EC', 'RSA', 'RSA-HSM', 'oct' + * + * @member {array} [key.keyOps] + * + * @member {buffer} [key.n] RSA modulus + * + * @member {buffer} [key.e] RSA public exponent + * + * @member {buffer} [key.d] RSA private exponent + * + * @member {buffer} [key.dp] RSA Private Key Parameter + * + * @member {buffer} [key.dq] RSA Private Key Parameter + * + * @member {buffer} [key.qi] RSA Private Key Parameter + * + * @member {buffer} [key.p] RSA secret prime + * + * @member {buffer} [key.q] RSA secret prime, with p < q + * + * @member {buffer} [key.k] Symmetric key + * + * @member {buffer} [key.t] HSM Token, used with Bring Your Own Key + * + * @member {object} [attributes] The key management attributes + * + * @member {object} [tags] Application-specific metadata in the form of + * key-value pairs + * + */ +export interface KeyBundle { + key?: JsonWebKey; + attributes?: KeyAttributes; + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the KeyItem class. + * @constructor + * The key item containing key metadata + * + * @member {string} [kid] Key Identifier + * + * @member {object} [attributes] The key management attributes + * + * @member {object} [tags] Application-specific metadata in the form of + * key-value pairs + * + */ +export interface KeyItem { + kid?: string; + attributes?: KeyAttributes; + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the SecretBundle class. + * @constructor + * A Secret consisting of a value, id and its attributes. + * + * @member {string} [value] The secret value + * + * @member {string} [id] The secret id + * + * @member {string} [contentType] The content type of the secret + * + * @member {object} [attributes] The secret management attributes + * + * @member {object} [tags] Application-specific metadata in the form of + * key-value pairs + * + * @member {string} [kid] The key id for certificate. + * + */ +export interface SecretBundle { + value?: string; + id?: string; + contentType?: string; + attributes?: SecretAttributes; + tags?: { [propertyName: string]: string }; + kid?: string; +} + +/** + * @class + * Initializes a new instance of the SecretAttributes class. + * @constructor + * The secret management attributes + * + */ +export interface SecretAttributes extends Attributes { +} + +/** + * @class + * Initializes a new instance of the SecretItem class. + * @constructor + * The secret item containing secret metadata + * + * @member {string} [id] Secret Identifier + * + * @member {object} [attributes] The secret management attributes + * + * @member {object} [tags] Application-specific metadata in the form of + * key-value pairs + * + * @member {string} [contentType] Type of the secret value such as a password + * + */ +export interface SecretItem { + id?: string; + attributes?: SecretAttributes; + tags?: { [propertyName: string]: string }; + contentType?: string; +} + +/** + * @class + * Initializes a new instance of the CertificateAttributes class. + * @constructor + * The certificate management attributes + * + */ +export interface CertificateAttributes extends Attributes { +} + +/** + * @class + * Initializes a new instance of the CertificateItem class. + * @constructor + * The certificate item containing certificate metadata + * + * @member {string} [id] Certificate Identifier + * + * @member {object} [attributes] The certificate management attributes + * + * @member {object} [tags] Application-specific metadata in the form of + * key-value pairs + * + * @member {buffer} [x509Thumbprint] Thumbprint of the certificate. + * + */ +export interface CertificateItem { + id?: string; + attributes?: CertificateAttributes; + tags?: { [propertyName: string]: string }; + x509Thumbprint?: Buffer; +} + +/** + * @class + * Initializes a new instance of the CertificateIssuerItem class. + * @constructor + * The certificate issuer item containing certificate issuer metadata + * + * @member {string} [id] Certificate Identifier + * + * @member {string} [provider] The name of the issuer. + * + */ +export interface CertificateIssuerItem { + id?: string; + provider?: string; +} + +/** + * @class + * Initializes a new instance of the CertificateBundle class. + * @constructor + * A certificate bundle consists of a certificate (X509) plus its attributes. + * + * @member {string} [id] The certificate id + * + * @member {string} [kid] The key id + * + * @member {string} [sid] The secret id + * + * @member {buffer} [x509Thumbprint] Thumbprint of the certificate. + * + * @member {object} [policy] The management policy. + * + * @member {string} [policy.id] The certificate id + * + * @member {object} [policy.keyProperties] Properties of the key backing a + * certificate. + * + * @member {boolean} [policy.keyProperties.exportable] Indicates if the + * private key can be exported. + * + * @member {string} [policy.keyProperties.keyType] The key type. + * + * @member {number} [policy.keyProperties.keySize] The key size in bytes. e.g. + * 1024 or 2048. + * + * @member {boolean} [policy.keyProperties.reuseKey] Indicates if the same key + * pair will be used on certificate renewal. + * + * @member {object} [policy.secretProperties] Properties of the secret backing + * a certificate. + * + * @member {string} [policy.secretProperties.contentType] The media type (MIME + * type). + * + * @member {object} [policy.x509CertificateProperties] Properties of the X509 + * component of a certificate. + * + * @member {string} [policy.x509CertificateProperties.subject] The subject + * name. Should be a valid X509 Distinguished Name. + * + * @member {array} [policy.x509CertificateProperties.ekus] The enhaunced key + * usage. + * + * @member {object} [policy.x509CertificateProperties.subjectAlternativeNames] + * The subject alternative names. + * + * @member {array} + * [policy.x509CertificateProperties.subjectAlternativeNames.emails] Email + * addresses. + * + * @member {array} + * [policy.x509CertificateProperties.subjectAlternativeNames.dnsNames] Domain + * names. + * + * @member {array} + * [policy.x509CertificateProperties.subjectAlternativeNames.upns] User + * principal names. + * + * @member {array} [policy.x509CertificateProperties.keyUsage] List of key + * usages. + * + * @member {number} [policy.x509CertificateProperties.validityInMonths] The + * subject alternate names. + * + * @member {array} [policy.lifetimeActions] Actions that will be performed by + * Key Vault over the lifetime of a certificate. + * + * @member {object} [policy.issuerReference] Reference to the issuer of the + * X509 component of a certificate. + * + * @member {string} [policy.issuerReference.name] Name of the referenced + * issuer object. + * + * @member {object} [policy.attributes] The certificate attributes. + * + * @member {buffer} [cer] CER contents of x509 certificate. + * + * @member {string} [contentType] The content type of the secret + * + * @member {object} [attributes] The certificate attributes. + * + * @member {object} [tags] Application-specific metadata in the form of + * key-value pairs + * + */ +export interface CertificateBundle { + id?: string; + kid?: string; + sid?: string; + x509Thumbprint?: Buffer; + policy?: CertificatePolicy; + cer?: Buffer; + contentType?: string; + attributes?: CertificateAttributes; + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the CertificatePolicy class. + * @constructor + * Management policy for a certificate. + * + * @member {string} [id] The certificate id + * + * @member {object} [keyProperties] Properties of the key backing a + * certificate. + * + * @member {boolean} [keyProperties.exportable] Indicates if the private key + * can be exported. + * + * @member {string} [keyProperties.keyType] The key type. + * + * @member {number} [keyProperties.keySize] The key size in bytes. e.g. 1024 + * or 2048. + * + * @member {boolean} [keyProperties.reuseKey] Indicates if the same key pair + * will be used on certificate renewal. + * + * @member {object} [secretProperties] Properties of the secret backing a + * certificate. + * + * @member {string} [secretProperties.contentType] The media type (MIME type). + * + * @member {object} [x509CertificateProperties] Properties of the X509 + * component of a certificate. + * + * @member {string} [x509CertificateProperties.subject] The subject name. + * Should be a valid X509 Distinguished Name. + * + * @member {array} [x509CertificateProperties.ekus] The enhaunced key usage. + * + * @member {object} [x509CertificateProperties.subjectAlternativeNames] The + * subject alternative names. + * + * @member {array} [x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @member {array} + * [x509CertificateProperties.subjectAlternativeNames.dnsNames] Domain names. + * + * @member {array} [x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @member {array} [x509CertificateProperties.keyUsage] List of key usages. + * + * @member {number} [x509CertificateProperties.validityInMonths] The subject + * alternate names. + * + * @member {array} [lifetimeActions] Actions that will be performed by Key + * Vault over the lifetime of a certificate. + * + * @member {object} [issuerReference] Reference to the issuer of the X509 + * component of a certificate. + * + * @member {string} [issuerReference.name] Name of the referenced issuer + * object. + * + * @member {object} [attributes] The certificate attributes. + * + */ +export interface CertificatePolicy { + id?: string; + keyProperties?: KeyProperties; + secretProperties?: SecretProperties; + x509CertificateProperties?: X509CertificateProperties; + lifetimeActions?: LifetimeAction[]; + issuerReference?: IssuerReference; + attributes?: CertificateAttributes; +} + +/** + * @class + * Initializes a new instance of the KeyProperties class. + * @constructor + * Properties of the key pair backing a certificate. + * + * @member {boolean} [exportable] Indicates if the private key can be exported. + * + * @member {string} [keyType] The key type. + * + * @member {number} [keySize] The key size in bytes. e.g. 1024 or 2048. + * + * @member {boolean} [reuseKey] Indicates if the same key pair will be used on + * certificate renewal. + * + */ +export interface KeyProperties { + exportable?: boolean; + keyType?: string; + keySize?: number; + reuseKey?: boolean; +} + +/** + * @class + * Initializes a new instance of the SecretProperties class. + * @constructor + * Properties of the key backing a certificate. + * + * @member {string} [contentType] The media type (MIME type). + * + */ +export interface SecretProperties { + contentType?: string; +} + +/** + * @class + * Initializes a new instance of the X509CertificateProperties class. + * @constructor + * Properties of the X509 component of a certificate. + * + * @member {string} [subject] The subject name. Should be a valid X509 + * Distinguished Name. + * + * @member {array} [ekus] The enhaunced key usage. + * + * @member {object} [subjectAlternativeNames] The subject alternative names. + * + * @member {array} [subjectAlternativeNames.emails] Email addresses. + * + * @member {array} [subjectAlternativeNames.dnsNames] Domain names. + * + * @member {array} [subjectAlternativeNames.upns] User principal names. + * + * @member {array} [keyUsage] List of key usages. + * + * @member {number} [validityInMonths] The subject alternate names. + * + */ +export interface X509CertificateProperties { + subject?: string; + ekus?: string[]; + subjectAlternativeNames?: SubjectAlternativeNames; + keyUsage?: string[]; + validityInMonths?: number; +} + +/** + * @class + * Initializes a new instance of the SubjectAlternativeNames class. + * @constructor + * The subject alternate names of a X509 object. + * + * @member {array} [emails] Email addresses. + * + * @member {array} [dnsNames] Domain names. + * + * @member {array} [upns] User principal names. + * + */ +export interface SubjectAlternativeNames { + emails?: string[]; + dnsNames?: string[]; + upns?: string[]; +} + +/** + * @class + * Initializes a new instance of the LifetimeAction class. + * @constructor + * Action and its trigger that will be performed by Key Vault over the + * lifetime of a certificate. + * + * @member {object} [trigger] The condition that will execute the action. + * + * @member {number} [trigger.lifetimePercentage] Percentage of lifetime as + * which to trigger. Value should be between 1 and 99. + * + * @member {number} [trigger.daysBeforeExpiry] Days before expiry. + * + * @member {object} [action] The action that will be executed. + * + * @member {string} [action.actionType] The type of the action. Possible + * values include: 'EmailContacts', 'AutoRenew' + * + */ +export interface LifetimeAction { + trigger?: Trigger; + action?: Action; +} + +/** + * @class + * Initializes a new instance of the Trigger class. + * @constructor + * A condition to be satisfied for an action to be executed. + * + * @member {number} [lifetimePercentage] Percentage of lifetime as which to + * trigger. Value should be between 1 and 99. + * + * @member {number} [daysBeforeExpiry] Days before expiry. + * + */ +export interface Trigger { + lifetimePercentage?: number; + daysBeforeExpiry?: number; +} + +/** + * @class + * Initializes a new instance of the Action class. + * @constructor + * The action that will be executed. + * + * @member {string} [actionType] The type of the action. Possible values + * include: 'EmailContacts', 'AutoRenew' + * + */ +export interface Action { + actionType?: string; +} + +/** + * @class + * Initializes a new instance of the IssuerReference class. + * @constructor + * Reference to the issuer of the X509 component of a certificate. + * + * @member {string} [name] Name of the referenced issuer object. + * + */ +export interface IssuerReference { + name?: string; +} + +/** + * @class + * Initializes a new instance of the CertificateOperation class. + * @constructor + * A certificate operation is returned in case of async requests. + * + * @member {string} [id] The certificate id + * + * @member {object} [issuerReference] Reference to the issuer of the X509 + * component of a certificate. + * + * @member {string} [issuerReference.name] Name of the referenced issuer + * object. + * + * @member {buffer} [csr] The Certificate Signing Request (CSR) that is being + * used in the certificate operation. + * + * @member {boolean} [cancellationRequested] Indicates if cancellation was + * requested on the certificate operation. + * + * @member {string} [status] Status of the certificate operation. + * + * @member {string} [statusDetails] The status details of the certificate + * operation. + * + * @member {object} [error] Error encountered, if any, during the certificate + * operation. + * + * @member {string} [error.code] The error code. + * + * @member {string} [error.message] The error message. + * + * @member {string} [target] Location which contains the result of the + * certificate operation. + * + * @member {string} [requestId] Identifier for the certificate operation. + * + */ +export interface CertificateOperation { + id?: string; + issuerReference?: IssuerReference; + csr?: Buffer; + cancellationRequested?: boolean; + status?: string; + statusDetails?: string; + error?: ErrorModel; + target?: string; + requestId?: string; +} + +/** + * @class + * Initializes a new instance of the ErrorModel class. + * @constructor + * The key vault server error + * + * @member {string} [code] The error code. + * + * @member {string} [message] The error message. + * + */ +export interface ErrorModel { + code?: string; + message?: string; +} + +/** + * @class + * Initializes a new instance of the IssuerBundle class. + * @constructor + * The issuer for Key Vault certificate + * + * @member {string} [id] Identifier for the issuer object. + * + * @member {string} [provider] The name of the issuer. + * + * @member {object} [credentials] The credentials to be used for the issuer. + * + * @member {string} [credentials.accountId] The user name/account name/account + * id. + * + * @member {string} [credentials.password] The password/secret/account key. + * + * @member {object} [organizationDetails] Details of the organization as + * provided to the issuer. + * + * @member {string} [organizationDetails.id] Id of the organization. + * + * @member {array} [organizationDetails.adminDetails] Details of the + * organization administrator. + * + * @member {object} [attributes] Attributes of the issuer object. + * + * @member {boolean} [attributes.enabled] Determines whether the issuer is + * enabled + * + * @member {date} [attributes.created] Creation time in UTC + * + * @member {date} [attributes.updated] Last updated time in UTC + * + */ +export interface IssuerBundle { + id?: string; + provider?: string; + credentials?: IssuerCredentials; + organizationDetails?: OrganizationDetails; + attributes?: IssuerAttributes; +} + +/** + * @class + * Initializes a new instance of the IssuerCredentials class. + * @constructor + * The credentials to be used for the certificate issuer. + * + * @member {string} [accountId] The user name/account name/account id. + * + * @member {string} [password] The password/secret/account key. + * + */ +export interface IssuerCredentials { + accountId?: string; + password?: string; +} + +/** + * @class + * Initializes a new instance of the OrganizationDetails class. + * @constructor + * Details of the organization of the certificate issuer. + * + * @member {string} [id] Id of the organization. + * + * @member {array} [adminDetails] Details of the organization administrator. + * + */ +export interface OrganizationDetails { + id?: string; + adminDetails?: AdministratorDetails[]; +} + +/** + * @class + * Initializes a new instance of the AdministratorDetails class. + * @constructor + * Details of the organization administrator of the certificate issuer + * + * @member {string} [firstName] First name. + * + * @member {string} [lastName] Last name. + * + * @member {string} [emailAddress] Email addresss. + * + * @member {string} [phone] Phone number. + * + */ +export interface AdministratorDetails { + firstName?: string; + lastName?: string; + emailAddress?: string; + phone?: string; +} + +/** + * @class + * Initializes a new instance of the IssuerAttributes class. + * @constructor + * The attributes of an issuer managed by the KeyVault service + * + * @member {boolean} [enabled] Determines whether the issuer is enabled + * + * @member {date} [created] Creation time in UTC + * + * @member {date} [updated] Last updated time in UTC + * + */ +export interface IssuerAttributes { + enabled?: boolean; + created?: Date; + updated?: Date; +} + +/** + * @class + * Initializes a new instance of the Contacts class. + * @constructor + * The contacts for the vault certificates. + * + * @member {string} [id] Identifier for the contacts collection. + * + * @member {array} [contactList] The contact list for the vault certificates. + * + */ +export interface Contacts { + id?: string; + contactList?: Contact[]; +} + +/** + * @class + * Initializes a new instance of the Contact class. + * @constructor + * The contact information for the vault certificates. + * + * @member {string} [emailAddress] Email addresss. + * + * @member {string} [name] Name. + * + * @member {string} [phone] Phone number. + * + */ +export interface Contact { + emailAddress?: string; + name?: string; + phone?: string; +} + +/** + * @class + * Initializes a new instance of the KeyCreateParameters class. + * @constructor + * The key create parameters + * + * @member {string} kty The type of key to create. Valid key types, see + * JsonWebKeyType. Possible values include: 'EC', 'RSA', 'RSA-HSM', 'oct' + * + * @member {number} [keySize] The key size in bytes. e.g. 1024 or 2048. + * + * @member {array} [keyOps] + * + * @member {object} [keyAttributes] + * + * @member {object} [tags] Application-specific metadata in the form of + * key-value pairs + * + */ +export interface KeyCreateParameters { + kty: string; + keySize?: number; + keyOps?: string[]; + keyAttributes?: KeyAttributes; + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the KeyImportParameters class. + * @constructor + * The key import parameters + * + * @member {boolean} [hsm] Whether to import as a hardware key (HSM) or + * software key + * + * @member {object} key The Json web key + * + * @member {string} [key.kid] Key Identifier + * + * @member {string} [key.kty] Key type, usually RSA. Possible values include: + * 'EC', 'RSA', 'RSA-HSM', 'oct' + * + * @member {array} [key.keyOps] + * + * @member {buffer} [key.n] RSA modulus + * + * @member {buffer} [key.e] RSA public exponent + * + * @member {buffer} [key.d] RSA private exponent + * + * @member {buffer} [key.dp] RSA Private Key Parameter + * + * @member {buffer} [key.dq] RSA Private Key Parameter + * + * @member {buffer} [key.qi] RSA Private Key Parameter + * + * @member {buffer} [key.p] RSA secret prime + * + * @member {buffer} [key.q] RSA secret prime, with p < q + * + * @member {buffer} [key.k] Symmetric key + * + * @member {buffer} [key.t] HSM Token, used with Bring Your Own Key + * + * @member {object} [keyAttributes] The key management attributes + * + * @member {object} [tags] Application-specific metadata in the form of + * key-value pairs + * + */ +export interface KeyImportParameters { + hsm?: boolean; + key: JsonWebKey; + keyAttributes?: KeyAttributes; + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the KeyOperationsParameters class. + * @constructor + * The key operations parameters + * + * @member {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA1_5' + * + * @member {buffer} value + * + */ +export interface KeyOperationsParameters { + algorithm: string; + value: Buffer; +} + +/** + * @class + * Initializes a new instance of the KeySignParameters class. + * @constructor + * The key operations parameters + * + * @member {string} algorithm The signing/verification algorithm identifier. + * For more information on possible algorithm types, see + * JsonWebKeySignatureAlgorithm. Possible values include: 'RS256', 'RS384', + * 'RS512', 'RSNULL' + * + * @member {buffer} value + * + */ +export interface KeySignParameters { + algorithm: string; + value: Buffer; +} + +/** + * @class + * Initializes a new instance of the KeyVerifyParameters class. + * @constructor + * The key verify parameters + * + * @member {string} algorithm The signing/verification algorithm. For more + * information on possible algorithm types, see JsonWebKeySignatureAlgorithm. + * Possible values include: 'RS256', 'RS384', 'RS512', 'RSNULL' + * + * @member {buffer} digest The digest used for signing + * + * @member {buffer} signature The signature to be verified + * + */ +export interface KeyVerifyParameters { + algorithm: string; + digest: Buffer; + signature: Buffer; +} + +/** + * @class + * Initializes a new instance of the KeyUpdateParameters class. + * @constructor + * The key update parameters + * + * @member {array} [keyOps] Json web key operations. For more information on + * possible key operations, see JsonWebKeyOperation. + * + * @member {object} [keyAttributes] + * + * @member {object} [tags] Application-specific metadata in the form of + * key-value pairs + * + */ +export interface KeyUpdateParameters { + keyOps?: string[]; + keyAttributes?: KeyAttributes; + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the KeyRestoreParameters class. + * @constructor + * The key restore parameters + * + * @member {buffer} keyBundleBackup the backup blob associated with a key + * bundle + * + */ +export interface KeyRestoreParameters { + keyBundleBackup: Buffer; +} + +/** + * @class + * Initializes a new instance of the SecretSetParameters class. + * @constructor + * The secret set parameters + * + * @member {string} value The value of the secret + * + * @member {object} [tags] Application-specific metadata in the form of + * key-value pairs + * + * @member {string} [contentType] Type of the secret value such as a password + * + * @member {object} [secretAttributes] The secret management attributes + * + */ +export interface SecretSetParameters { + value: string; + tags?: { [propertyName: string]: string }; + contentType?: string; + secretAttributes?: SecretAttributes; +} + +/** + * @class + * Initializes a new instance of the SecretUpdateParameters class. + * @constructor + * The secret update parameters + * + * @member {string} [contentType] Type of the secret value such as a password + * + * @member {object} [secretAttributes] The secret management attributes + * + * @member {object} [tags] Application-specific metadata in the form of + * key-value pairs + * + */ +export interface SecretUpdateParameters { + contentType?: string; + secretAttributes?: SecretAttributes; + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the CertificateCreateParameters class. + * @constructor + * The certificate create parameters + * + * @member {object} [certificatePolicy] The management policy for the + * certificate + * + * @member {string} [certificatePolicy.id] The certificate id + * + * @member {object} [certificatePolicy.keyProperties] Properties of the key + * backing a certificate. + * + * @member {boolean} [certificatePolicy.keyProperties.exportable] Indicates if + * the private key can be exported. + * + * @member {string} [certificatePolicy.keyProperties.keyType] The key type. + * + * @member {number} [certificatePolicy.keyProperties.keySize] The key size in + * bytes. e.g. 1024 or 2048. + * + * @member {boolean} [certificatePolicy.keyProperties.reuseKey] Indicates if + * the same key pair will be used on certificate renewal. + * + * @member {object} [certificatePolicy.secretProperties] Properties of the + * secret backing a certificate. + * + * @member {string} [certificatePolicy.secretProperties.contentType] The media + * type (MIME type). + * + * @member {object} [certificatePolicy.x509CertificateProperties] Properties + * of the X509 component of a certificate. + * + * @member {string} [certificatePolicy.x509CertificateProperties.subject] The + * subject name. Should be a valid X509 Distinguished Name. + * + * @member {array} [certificatePolicy.x509CertificateProperties.ekus] The + * enhaunced key usage. + * + * @member {object} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames] The + * subject alternative names. + * + * @member {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @member {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * + * @member {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @member {array} [certificatePolicy.x509CertificateProperties.keyUsage] List + * of key usages. + * + * @member {number} + * [certificatePolicy.x509CertificateProperties.validityInMonths] The subject + * alternate names. + * + * @member {array} [certificatePolicy.lifetimeActions] Actions that will be + * performed by Key Vault over the lifetime of a certificate. + * + * @member {object} [certificatePolicy.issuerReference] Reference to the + * issuer of the X509 component of a certificate. + * + * @member {string} [certificatePolicy.issuerReference.name] Name of the + * referenced issuer object. + * + * @member {object} [certificatePolicy.attributes] The certificate attributes. + * + * @member {object} [certificateAttributes] The attributes of the certificate + * (optional) + * + * @member {object} [tags] Application-specific metadata in the form of + * key-value pairs + * + */ +export interface CertificateCreateParameters { + certificatePolicy?: CertificatePolicy; + certificateAttributes?: CertificateAttributes; + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the CertificateImportParameters class. + * @constructor + * The certificate import parameters + * + * @member {string} base64EncodedCertificate Base64 encoded representation of + * the certificate object to import. This certificate needs to contain the + * private key. + * + * @member {string} [password] If the private key in base64EncodedCertificate + * is encrypted, the password used for encryption + * + * @member {object} [certificatePolicy] The management policy for the + * certificate + * + * @member {string} [certificatePolicy.id] The certificate id + * + * @member {object} [certificatePolicy.keyProperties] Properties of the key + * backing a certificate. + * + * @member {boolean} [certificatePolicy.keyProperties.exportable] Indicates if + * the private key can be exported. + * + * @member {string} [certificatePolicy.keyProperties.keyType] The key type. + * + * @member {number} [certificatePolicy.keyProperties.keySize] The key size in + * bytes. e.g. 1024 or 2048. + * + * @member {boolean} [certificatePolicy.keyProperties.reuseKey] Indicates if + * the same key pair will be used on certificate renewal. + * + * @member {object} [certificatePolicy.secretProperties] Properties of the + * secret backing a certificate. + * + * @member {string} [certificatePolicy.secretProperties.contentType] The media + * type (MIME type). + * + * @member {object} [certificatePolicy.x509CertificateProperties] Properties + * of the X509 component of a certificate. + * + * @member {string} [certificatePolicy.x509CertificateProperties.subject] The + * subject name. Should be a valid X509 Distinguished Name. + * + * @member {array} [certificatePolicy.x509CertificateProperties.ekus] The + * enhaunced key usage. + * + * @member {object} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames] The + * subject alternative names. + * + * @member {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.emails] + * Email addresses. + * + * @member {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.dnsNames] + * Domain names. + * + * @member {array} + * [certificatePolicy.x509CertificateProperties.subjectAlternativeNames.upns] + * User principal names. + * + * @member {array} [certificatePolicy.x509CertificateProperties.keyUsage] List + * of key usages. + * + * @member {number} + * [certificatePolicy.x509CertificateProperties.validityInMonths] The subject + * alternate names. + * + * @member {array} [certificatePolicy.lifetimeActions] Actions that will be + * performed by Key Vault over the lifetime of a certificate. + * + * @member {object} [certificatePolicy.issuerReference] Reference to the + * issuer of the X509 component of a certificate. + * + * @member {string} [certificatePolicy.issuerReference.name] Name of the + * referenced issuer object. + * + * @member {object} [certificatePolicy.attributes] The certificate attributes. + * + * @member {object} [certificateAttributes] The attributes of the certificate + * (optional) + * + * @member {object} [tags] Application-specific metadata in the form of + * key-value pairs + * + */ +export interface CertificateImportParameters { + base64EncodedCertificate: string; + password?: string; + certificatePolicy?: CertificatePolicy; + certificateAttributes?: CertificateAttributes; + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the CertificateUpdateParameters class. + * @constructor + * The certificate update parameters + * + * @member {object} [certificateAttributes] The attributes of the certificate + * (optional) + * + * @member {object} [tags] Application-specific metadata in the form of + * key-value pairs + * + */ +export interface CertificateUpdateParameters { + certificateAttributes?: CertificateAttributes; + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the CertificateMergeParameters class. + * @constructor + * The certificate merge parameters + * + * @member {array} x509Certificates The certificate or the certificate chain + * to merge + * + * @member {object} [certificateAttributes] The attributes of the certificate + * (optional) + * + * @member {object} [tags] Application-specific metadata in the form of + * key-value pairs + * + */ +export interface CertificateMergeParameters { + x509Certificates: Buffer[]; + certificateAttributes?: CertificateAttributes; + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the KeyOperationResult class. + * @constructor + * The key operation result + * + * @member {string} [kid] Key identifier + * + * @member {buffer} [result] + * + */ +export interface KeyOperationResult { + kid?: string; + result?: Buffer; +} + +/** + * @class + * Initializes a new instance of the KeyVerifyResult class. + * @constructor + * The key verify result + * + * @member {boolean} [value] true if the signature is verified, false + * otherwise. + * + */ +export interface KeyVerifyResult { + value?: boolean; +} + +/** + * @class + * Initializes a new instance of the BackupKeyResult class. + * @constructor + * The backup key result, containing the backup blob + * + * @member {buffer} [value] The backup blob containing the backed up key + * + */ +export interface BackupKeyResult { + value?: Buffer; +} + +/** + * @class + * Initializes a new instance of the PendingCertificateSigningRequestResult class. + * @constructor + * The pending certificate signing request result + * + * @member {string} [value] The pending certificate signing request as Base64 + * encoded string. + * + */ +export interface PendingCertificateSigningRequestResult { + value?: string; +} + +/** + * @class + * Initializes a new instance of the KeyVaultError class. + * @constructor + * the key vault error exception + * + * @member {object} [error] + * + * @member {string} [error.code] The error code. + * + * @member {string} [error.message] The error message. + * + */ +export interface KeyVaultError { + error?: ErrorModel; +} diff --git a/lib/services/keyVault/lib/models/index.js b/lib/services/keyVault/lib/models/index.js new file mode 100644 index 000000000..8406f9b56 --- /dev/null +++ b/lib/services/keyVault/lib/models/index.js @@ -0,0 +1,72 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +/* jshint latedef:false */ +/* jshint forin:false */ +/* jshint noempty:false */ + +'use strict'; + +var msRestAzure = require('ms-rest-azure'); + +exports.BaseResource = msRestAzure.BaseResource; +exports.CloudError = msRestAzure.CloudError; +exports.Attributes = require('./attributes'); +exports.JsonWebKey = require('./jsonWebKey'); +exports.KeyAttributes = require('./keyAttributes'); +exports.KeyBundle = require('./keyBundle'); +exports.KeyItem = require('./keyItem'); +exports.SecretBundle = require('./secretBundle'); +exports.SecretAttributes = require('./secretAttributes'); +exports.SecretItem = require('./secretItem'); +exports.CertificateAttributes = require('./certificateAttributes'); +exports.CertificateItem = require('./certificateItem'); +exports.CertificateIssuerItem = require('./certificateIssuerItem'); +exports.CertificateBundle = require('./certificateBundle'); +exports.CertificatePolicy = require('./certificatePolicy'); +exports.KeyProperties = require('./keyProperties'); +exports.SecretProperties = require('./secretProperties'); +exports.X509CertificateProperties = require('./x509CertificateProperties'); +exports.SubjectAlternativeNames = require('./subjectAlternativeNames'); +exports.LifetimeAction = require('./lifetimeAction'); +exports.Trigger = require('./trigger'); +exports.Action = require('./action'); +exports.IssuerReference = require('./issuerReference'); +exports.CertificateOperation = require('./certificateOperation'); +exports.ErrorModel = require('./errorModel'); +exports.IssuerBundle = require('./issuerBundle'); +exports.IssuerCredentials = require('./issuerCredentials'); +exports.OrganizationDetails = require('./organizationDetails'); +exports.AdministratorDetails = require('./administratorDetails'); +exports.IssuerAttributes = require('./issuerAttributes'); +exports.Contacts = require('./contacts'); +exports.Contact = require('./contact'); +exports.KeyCreateParameters = require('./keyCreateParameters'); +exports.KeyImportParameters = require('./keyImportParameters'); +exports.KeyOperationsParameters = require('./keyOperationsParameters'); +exports.KeySignParameters = require('./keySignParameters'); +exports.KeyVerifyParameters = require('./keyVerifyParameters'); +exports.KeyUpdateParameters = require('./keyUpdateParameters'); +exports.KeyRestoreParameters = require('./keyRestoreParameters'); +exports.SecretSetParameters = require('./secretSetParameters'); +exports.SecretUpdateParameters = require('./secretUpdateParameters'); +exports.CertificateCreateParameters = require('./certificateCreateParameters'); +exports.CertificateImportParameters = require('./certificateImportParameters'); +exports.CertificateUpdateParameters = require('./certificateUpdateParameters'); +exports.CertificateMergeParameters = require('./certificateMergeParameters'); +exports.KeyOperationResult = require('./keyOperationResult'); +exports.KeyVerifyResult = require('./keyVerifyResult'); +exports.BackupKeyResult = require('./backupKeyResult'); +exports.PendingCertificateSigningRequestResult = require('./pendingCertificateSigningRequestResult'); +exports.KeyVaultError = require('./keyVaultError'); +exports.KeyListResult = require('./keyListResult'); +exports.SecretListResult = require('./secretListResult'); +exports.CertificateListResult = require('./certificateListResult'); +exports.CertificateIssuerListResult = require('./certificateIssuerListResult'); diff --git a/lib/services/keyVault/lib/models/issuerAttributes.js b/lib/services/keyVault/lib/models/issuerAttributes.js new file mode 100644 index 000000000..97fde7412 --- /dev/null +++ b/lib/services/keyVault/lib/models/issuerAttributes.js @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * @class + * Initializes a new instance of the IssuerAttributes class. + * @constructor + * The attributes of an issuer managed by the KeyVault service + * + * @member {boolean} [enabled] Determines whether the issuer is enabled + * + * @member {date} [created] Creation time in UTC + * + * @member {date} [updated] Last updated time in UTC + * + */ +function IssuerAttributes() { +} + +/** + * Defines the metadata of IssuerAttributes + * + * @returns {object} metadata of IssuerAttributes + * + */ +IssuerAttributes.prototype.mapper = function () { + return { + required: false, + serializedName: 'IssuerAttributes', + type: { + name: 'Composite', + className: 'IssuerAttributes', + modelProperties: { + enabled: { + required: false, + serializedName: 'enabled', + type: { + name: 'Boolean' + } + }, + created: { + required: false, + readOnly: true, + serializedName: 'created', + type: { + name: 'UnixTime' + } + }, + updated: { + required: false, + readOnly: true, + serializedName: 'updated', + type: { + name: 'UnixTime' + } + } + } + } + }; +}; + +module.exports = IssuerAttributes; diff --git a/lib/services/keyVault/lib/models/issuerBundle.js b/lib/services/keyVault/lib/models/issuerBundle.js new file mode 100644 index 000000000..93bb29123 --- /dev/null +++ b/lib/services/keyVault/lib/models/issuerBundle.js @@ -0,0 +1,111 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var models = require('./index'); + +/** + * @class + * Initializes a new instance of the IssuerBundle class. + * @constructor + * The issuer for Key Vault certificate + * + * @member {string} [id] Identifier for the issuer object. + * + * @member {string} [provider] The name of the issuer. + * + * @member {object} [credentials] The credentials to be used for the issuer. + * + * @member {string} [credentials.accountId] The user name/account name/account + * id. + * + * @member {string} [credentials.password] The password/secret/account key. + * + * @member {object} [organizationDetails] Details of the organization as + * provided to the issuer. + * + * @member {string} [organizationDetails.id] Id of the organization. + * + * @member {array} [organizationDetails.adminDetails] Details of the + * organization administrator. + * + * @member {object} [attributes] Attributes of the issuer object. + * + * @member {boolean} [attributes.enabled] Determines whether the issuer is + * enabled + * + * @member {date} [attributes.created] Creation time in UTC + * + * @member {date} [attributes.updated] Last updated time in UTC + * + */ +function IssuerBundle() { +} + +/** + * Defines the metadata of IssuerBundle + * + * @returns {object} metadata of IssuerBundle + * + */ +IssuerBundle.prototype.mapper = function () { + return { + required: false, + serializedName: 'IssuerBundle', + type: { + name: 'Composite', + className: 'IssuerBundle', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + provider: { + required: false, + serializedName: 'provider', + type: { + name: 'String' + } + }, + credentials: { + required: false, + serializedName: 'credentials', + type: { + name: 'Composite', + className: 'IssuerCredentials' + } + }, + organizationDetails: { + required: false, + serializedName: 'org_details', + type: { + name: 'Composite', + className: 'OrganizationDetails' + } + }, + attributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'IssuerAttributes' + } + } + } + } + }; +}; + +module.exports = IssuerBundle; diff --git a/lib/services/keyVault/lib/models/issuerCredentials.js b/lib/services/keyVault/lib/models/issuerCredentials.js new file mode 100644 index 000000000..4c07fd5d4 --- /dev/null +++ b/lib/services/keyVault/lib/models/issuerCredentials.js @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * @class + * Initializes a new instance of the IssuerCredentials class. + * @constructor + * The credentials to be used for the certificate issuer. + * + * @member {string} [accountId] The user name/account name/account id. + * + * @member {string} [password] The password/secret/account key. + * + */ +function IssuerCredentials() { +} + +/** + * Defines the metadata of IssuerCredentials + * + * @returns {object} metadata of IssuerCredentials + * + */ +IssuerCredentials.prototype.mapper = function () { + return { + required: false, + serializedName: 'IssuerCredentials', + type: { + name: 'Composite', + className: 'IssuerCredentials', + modelProperties: { + accountId: { + required: false, + serializedName: 'account_id', + type: { + name: 'String' + } + }, + password: { + required: false, + serializedName: 'pwd', + type: { + name: 'String' + } + } + } + } + }; +}; + +module.exports = IssuerCredentials; diff --git a/lib/services/keyVault/lib/models/issuerReference.js b/lib/services/keyVault/lib/models/issuerReference.js new file mode 100644 index 000000000..ea3cc92e7 --- /dev/null +++ b/lib/services/keyVault/lib/models/issuerReference.js @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * @class + * Initializes a new instance of the IssuerReference class. + * @constructor + * Reference to the issuer of the X509 component of a certificate. + * + * @member {string} [name] Name of the referenced issuer object. + * + */ +function IssuerReference() { +} + +/** + * Defines the metadata of IssuerReference + * + * @returns {object} metadata of IssuerReference + * + */ +IssuerReference.prototype.mapper = function () { + return { + required: false, + serializedName: 'IssuerReference', + type: { + name: 'Composite', + className: 'IssuerReference', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + } + } + } + }; +}; + +module.exports = IssuerReference; diff --git a/lib/services/keyVault/lib/models/jsonWebKey.js b/lib/services/keyVault/lib/models/jsonWebKey.js new file mode 100644 index 000000000..101acce14 --- /dev/null +++ b/lib/services/keyVault/lib/models/jsonWebKey.js @@ -0,0 +1,169 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var util = require('util'); + +/** + * @class + * Initializes a new instance of the JsonWebKey class. + * @constructor + * As of http://tools.ietf.org/html/draft-ietf-jose-json-web-key-18 + * + * @member {string} [kid] Key Identifier + * + * @member {string} [kty] Key type, usually RSA. Possible values include: + * 'EC', 'RSA', 'RSA-HSM', 'oct' + * + * @member {array} [keyOps] + * + * @member {buffer} [n] RSA modulus + * + * @member {buffer} [e] RSA public exponent + * + * @member {buffer} [d] RSA private exponent + * + * @member {buffer} [dp] RSA Private Key Parameter + * + * @member {buffer} [dq] RSA Private Key Parameter + * + * @member {buffer} [qi] RSA Private Key Parameter + * + * @member {buffer} [p] RSA secret prime + * + * @member {buffer} [q] RSA secret prime, with p < q + * + * @member {buffer} [k] Symmetric key + * + * @member {buffer} [t] HSM Token, used with Bring Your Own Key + * + */ +function JsonWebKey() { +} + +/** + * Defines the metadata of JsonWebKey + * + * @returns {object} metadata of JsonWebKey + * + */ +JsonWebKey.prototype.mapper = function () { + return { + required: false, + serializedName: 'JsonWebKey', + type: { + name: 'Composite', + className: 'JsonWebKey', + modelProperties: { + kid: { + required: false, + serializedName: 'kid', + type: { + name: 'String' + } + }, + kty: { + required: false, + serializedName: 'kty', + type: { + name: 'String' + } + }, + keyOps: { + required: false, + serializedName: 'key_ops', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + n: { + required: false, + serializedName: 'n', + type: { + name: 'Base64Url' + } + }, + e: { + required: false, + serializedName: 'e', + type: { + name: 'Base64Url' + } + }, + d: { + required: false, + serializedName: 'd', + type: { + name: 'Base64Url' + } + }, + dp: { + required: false, + serializedName: 'dp', + type: { + name: 'Base64Url' + } + }, + dq: { + required: false, + serializedName: 'dq', + type: { + name: 'Base64Url' + } + }, + qi: { + required: false, + serializedName: 'qi', + type: { + name: 'Base64Url' + } + }, + p: { + required: false, + serializedName: 'p', + type: { + name: 'Base64Url' + } + }, + q: { + required: false, + serializedName: 'q', + type: { + name: 'Base64Url' + } + }, + k: { + required: false, + serializedName: 'K', + type: { + name: 'Base64Url' + } + }, + t: { + required: false, + serializedName: 'key_hsm', + type: { + name: 'Base64Url' + } + } + } + } + }; +}; + +module.exports = JsonWebKey; diff --git a/lib/services/keyVault/lib/models/keyAttributes.js b/lib/services/keyVault/lib/models/keyAttributes.js new file mode 100644 index 000000000..a4982b8fa --- /dev/null +++ b/lib/services/keyVault/lib/models/keyAttributes.js @@ -0,0 +1,86 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var models = require('./index'); + +var util = require('util'); + +/** + * @class + * Initializes a new instance of the KeyAttributes class. + * @constructor + * The attributes of a key managed by the KeyVault service + * + */ +function KeyAttributes() { + KeyAttributes['super_'].call(this); +} + +util.inherits(KeyAttributes, models['Attributes']); + +/** + * Defines the metadata of KeyAttributes + * + * @returns {object} metadata of KeyAttributes + * + */ +KeyAttributes.prototype.mapper = function () { + return { + required: false, + serializedName: 'KeyAttributes', + type: { + name: 'Composite', + className: 'KeyAttributes', + modelProperties: { + enabled: { + required: false, + serializedName: 'enabled', + type: { + name: 'Boolean' + } + }, + notBefore: { + required: false, + serializedName: 'nbf', + type: { + name: 'UnixTime' + } + }, + expires: { + required: false, + serializedName: 'exp', + type: { + name: 'UnixTime' + } + }, + created: { + required: false, + readOnly: true, + serializedName: 'created', + type: { + name: 'UnixTime' + } + }, + updated: { + required: false, + readOnly: true, + serializedName: 'updated', + type: { + name: 'UnixTime' + } + } + } + } + }; +}; + +module.exports = KeyAttributes; diff --git a/lib/services/keyVault/lib/models/keyBundle.js b/lib/services/keyVault/lib/models/keyBundle.js new file mode 100644 index 000000000..de8248ba1 --- /dev/null +++ b/lib/services/keyVault/lib/models/keyBundle.js @@ -0,0 +1,108 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var models = require('./index'); + +/** + * @class + * Initializes a new instance of the KeyBundle class. + * @constructor + * A KeyBundle consisting of a WebKey plus its Attributes + * + * @member {object} [key] The Json web key + * + * @member {string} [key.kid] Key Identifier + * + * @member {string} [key.kty] Key type, usually RSA. Possible values include: + * 'EC', 'RSA', 'RSA-HSM', 'oct' + * + * @member {array} [key.keyOps] + * + * @member {buffer} [key.n] RSA modulus + * + * @member {buffer} [key.e] RSA public exponent + * + * @member {buffer} [key.d] RSA private exponent + * + * @member {buffer} [key.dp] RSA Private Key Parameter + * + * @member {buffer} [key.dq] RSA Private Key Parameter + * + * @member {buffer} [key.qi] RSA Private Key Parameter + * + * @member {buffer} [key.p] RSA secret prime + * + * @member {buffer} [key.q] RSA secret prime, with p < q + * + * @member {buffer} [key.k] Symmetric key + * + * @member {buffer} [key.t] HSM Token, used with Bring Your Own Key + * + * @member {object} [attributes] The key management attributes + * + * @member {object} [tags] Application-specific metadata in the form of + * key-value pairs + * + */ +function KeyBundle() { +} + +/** + * Defines the metadata of KeyBundle + * + * @returns {object} metadata of KeyBundle + * + */ +KeyBundle.prototype.mapper = function () { + return { + required: false, + serializedName: 'KeyBundle', + type: { + name: 'Composite', + className: 'KeyBundle', + modelProperties: { + key: { + required: false, + serializedName: 'key', + type: { + name: 'Composite', + className: 'JsonWebKey' + } + }, + attributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'KeyAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; +}; + +module.exports = KeyBundle; diff --git a/lib/services/keyVault/lib/models/keyCreateParameters.js b/lib/services/keyVault/lib/models/keyCreateParameters.js new file mode 100644 index 000000000..5ae0566e8 --- /dev/null +++ b/lib/services/keyVault/lib/models/keyCreateParameters.js @@ -0,0 +1,111 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var models = require('./index'); + +var util = require('util'); + +/** + * @class + * Initializes a new instance of the KeyCreateParameters class. + * @constructor + * The key create parameters + * + * @member {string} kty The type of key to create. Valid key types, see + * JsonWebKeyType. Possible values include: 'EC', 'RSA', 'RSA-HSM', 'oct' + * + * @member {number} [keySize] The key size in bytes. e.g. 1024 or 2048. + * + * @member {array} [keyOps] + * + * @member {object} [keyAttributes] + * + * @member {object} [tags] Application-specific metadata in the form of + * key-value pairs + * + */ +function KeyCreateParameters() { +} + +/** + * Defines the metadata of KeyCreateParameters + * + * @returns {object} metadata of KeyCreateParameters + * + */ +KeyCreateParameters.prototype.mapper = function () { + return { + required: false, + serializedName: 'KeyCreateParameters', + type: { + name: 'Composite', + className: 'KeyCreateParameters', + modelProperties: { + kty: { + required: true, + serializedName: 'kty', + constraints: { + MinLength: 1 + }, + type: { + name: 'String' + } + }, + keySize: { + required: false, + serializedName: 'key_size', + type: { + name: 'Number' + } + }, + keyOps: { + required: false, + serializedName: 'key_ops', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + keyAttributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'KeyAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; +}; + +module.exports = KeyCreateParameters; diff --git a/lib/services/keyVault/lib/models/keyImportParameters.js b/lib/services/keyVault/lib/models/keyImportParameters.js new file mode 100644 index 000000000..22e98aafb --- /dev/null +++ b/lib/services/keyVault/lib/models/keyImportParameters.js @@ -0,0 +1,118 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var models = require('./index'); + +/** + * @class + * Initializes a new instance of the KeyImportParameters class. + * @constructor + * The key import parameters + * + * @member {boolean} [hsm] Whether to import as a hardware key (HSM) or + * software key + * + * @member {object} key The Json web key + * + * @member {string} [key.kid] Key Identifier + * + * @member {string} [key.kty] Key type, usually RSA. Possible values include: + * 'EC', 'RSA', 'RSA-HSM', 'oct' + * + * @member {array} [key.keyOps] + * + * @member {buffer} [key.n] RSA modulus + * + * @member {buffer} [key.e] RSA public exponent + * + * @member {buffer} [key.d] RSA private exponent + * + * @member {buffer} [key.dp] RSA Private Key Parameter + * + * @member {buffer} [key.dq] RSA Private Key Parameter + * + * @member {buffer} [key.qi] RSA Private Key Parameter + * + * @member {buffer} [key.p] RSA secret prime + * + * @member {buffer} [key.q] RSA secret prime, with p < q + * + * @member {buffer} [key.k] Symmetric key + * + * @member {buffer} [key.t] HSM Token, used with Bring Your Own Key + * + * @member {object} [keyAttributes] The key management attributes + * + * @member {object} [tags] Application-specific metadata in the form of + * key-value pairs + * + */ +function KeyImportParameters() { +} + +/** + * Defines the metadata of KeyImportParameters + * + * @returns {object} metadata of KeyImportParameters + * + */ +KeyImportParameters.prototype.mapper = function () { + return { + required: false, + serializedName: 'KeyImportParameters', + type: { + name: 'Composite', + className: 'KeyImportParameters', + modelProperties: { + hsm: { + required: false, + serializedName: 'Hsm', + type: { + name: 'Boolean' + } + }, + key: { + required: true, + serializedName: 'key', + type: { + name: 'Composite', + className: 'JsonWebKey' + } + }, + keyAttributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'KeyAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; +}; + +module.exports = KeyImportParameters; diff --git a/lib/services/keyVault/lib/models/keyItem.js b/lib/services/keyVault/lib/models/keyItem.js new file mode 100644 index 000000000..11e3d3da1 --- /dev/null +++ b/lib/services/keyVault/lib/models/keyItem.js @@ -0,0 +1,80 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var models = require('./index'); + +/** + * @class + * Initializes a new instance of the KeyItem class. + * @constructor + * The key item containing key metadata + * + * @member {string} [kid] Key Identifier + * + * @member {object} [attributes] The key management attributes + * + * @member {object} [tags] Application-specific metadata in the form of + * key-value pairs + * + */ +function KeyItem() { +} + +/** + * Defines the metadata of KeyItem + * + * @returns {object} metadata of KeyItem + * + */ +KeyItem.prototype.mapper = function () { + return { + required: false, + serializedName: 'KeyItem', + type: { + name: 'Composite', + className: 'KeyItem', + modelProperties: { + kid: { + required: false, + serializedName: 'kid', + type: { + name: 'String' + } + }, + attributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'KeyAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; +}; + +module.exports = KeyItem; diff --git a/lib/services/keyVault/lib/models/keyListResult.js b/lib/services/keyVault/lib/models/keyListResult.js new file mode 100644 index 000000000..a53feac25 --- /dev/null +++ b/lib/services/keyVault/lib/models/keyListResult.js @@ -0,0 +1,74 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var util = require('util'); + +/** + * @class + * Initializes a new instance of the KeyListResult class. + * @constructor + * The key list result + * @member {array} [value] A response message containing a list of keys in the + * vault along with a link to the next page of keys + * + * @member {string} [nextLink] The URL to get the next set of keys. + * + */ +function KeyListResult() { +} + +util.inherits(KeyListResult, Array); + +/** + * Defines the metadata of KeyListResult + * + * @returns {object} metadata of KeyListResult + * + */ +KeyListResult.prototype.mapper = function () { + return { + required: false, + serializedName: 'KeyListResult', + type: { + name: 'Composite', + className: 'KeyListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'KeyItemElementType', + type: { + name: 'Composite', + className: 'KeyItem' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; +}; + +module.exports = KeyListResult; diff --git a/lib/services/keyVault/lib/models/keyOperationResult.js b/lib/services/keyVault/lib/models/keyOperationResult.js new file mode 100644 index 000000000..4dc36f535 --- /dev/null +++ b/lib/services/keyVault/lib/models/keyOperationResult.js @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * @class + * Initializes a new instance of the KeyOperationResult class. + * @constructor + * The key operation result + * + * @member {string} [kid] Key identifier + * + * @member {buffer} [result] + * + */ +function KeyOperationResult() { +} + +/** + * Defines the metadata of KeyOperationResult + * + * @returns {object} metadata of KeyOperationResult + * + */ +KeyOperationResult.prototype.mapper = function () { + return { + required: false, + serializedName: 'KeyOperationResult', + type: { + name: 'Composite', + className: 'KeyOperationResult', + modelProperties: { + kid: { + required: false, + readOnly: true, + serializedName: 'kid', + type: { + name: 'String' + } + }, + result: { + required: false, + readOnly: true, + serializedName: 'value', + type: { + name: 'Base64Url' + } + } + } + } + }; +}; + +module.exports = KeyOperationResult; diff --git a/lib/services/keyVault/lib/models/keyOperationsParameters.js b/lib/services/keyVault/lib/models/keyOperationsParameters.js new file mode 100644 index 000000000..eb372fe24 --- /dev/null +++ b/lib/services/keyVault/lib/models/keyOperationsParameters.js @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * @class + * Initializes a new instance of the KeyOperationsParameters class. + * @constructor + * The key operations parameters + * + * @member {string} algorithm algorithm identifier. Possible values include: + * 'RSA-OAEP', 'RSA1_5' + * + * @member {buffer} value + * + */ +function KeyOperationsParameters() { +} + +/** + * Defines the metadata of KeyOperationsParameters + * + * @returns {object} metadata of KeyOperationsParameters + * + */ +KeyOperationsParameters.prototype.mapper = function () { + return { + required: false, + serializedName: 'KeyOperationsParameters', + type: { + name: 'Composite', + className: 'KeyOperationsParameters', + modelProperties: { + algorithm: { + required: true, + serializedName: 'alg', + constraints: { + MinLength: 1 + }, + type: { + name: 'String' + } + }, + value: { + required: true, + serializedName: 'value', + type: { + name: 'Base64Url' + } + } + } + } + }; +}; + +module.exports = KeyOperationsParameters; diff --git a/lib/services/keyVault/lib/models/keyProperties.js b/lib/services/keyVault/lib/models/keyProperties.js new file mode 100644 index 000000000..a9899d91e --- /dev/null +++ b/lib/services/keyVault/lib/models/keyProperties.js @@ -0,0 +1,79 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * @class + * Initializes a new instance of the KeyProperties class. + * @constructor + * Properties of the key pair backing a certificate. + * + * @member {boolean} [exportable] Indicates if the private key can be exported. + * + * @member {string} [keyType] The key type. + * + * @member {number} [keySize] The key size in bytes. e.g. 1024 or 2048. + * + * @member {boolean} [reuseKey] Indicates if the same key pair will be used on + * certificate renewal. + * + */ +function KeyProperties() { +} + +/** + * Defines the metadata of KeyProperties + * + * @returns {object} metadata of KeyProperties + * + */ +KeyProperties.prototype.mapper = function () { + return { + required: false, + serializedName: 'KeyProperties', + type: { + name: 'Composite', + className: 'KeyProperties', + modelProperties: { + exportable: { + required: false, + serializedName: 'exportable', + type: { + name: 'Boolean' + } + }, + keyType: { + required: false, + serializedName: 'kty', + type: { + name: 'String' + } + }, + keySize: { + required: false, + serializedName: 'key_size', + type: { + name: 'Number' + } + }, + reuseKey: { + required: false, + serializedName: 'reuse_key', + type: { + name: 'Boolean' + } + } + } + } + }; +}; + +module.exports = KeyProperties; diff --git a/lib/services/keyVault/lib/models/keyRestoreParameters.js b/lib/services/keyVault/lib/models/keyRestoreParameters.js new file mode 100644 index 000000000..bdcd69ff9 --- /dev/null +++ b/lib/services/keyVault/lib/models/keyRestoreParameters.js @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * @class + * Initializes a new instance of the KeyRestoreParameters class. + * @constructor + * The key restore parameters + * + * @member {buffer} keyBundleBackup the backup blob associated with a key + * bundle + * + */ +function KeyRestoreParameters() { +} + +/** + * Defines the metadata of KeyRestoreParameters + * + * @returns {object} metadata of KeyRestoreParameters + * + */ +KeyRestoreParameters.prototype.mapper = function () { + return { + required: false, + serializedName: 'KeyRestoreParameters', + type: { + name: 'Composite', + className: 'KeyRestoreParameters', + modelProperties: { + keyBundleBackup: { + required: true, + serializedName: 'value', + type: { + name: 'Base64Url' + } + } + } + } + }; +}; + +module.exports = KeyRestoreParameters; diff --git a/lib/services/keyVault/lib/models/keySignParameters.js b/lib/services/keyVault/lib/models/keySignParameters.js new file mode 100644 index 000000000..1ba1f1b73 --- /dev/null +++ b/lib/services/keyVault/lib/models/keySignParameters.js @@ -0,0 +1,66 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * @class + * Initializes a new instance of the KeySignParameters class. + * @constructor + * The key operations parameters + * + * @member {string} algorithm The signing/verification algorithm identifier. + * For more information on possible algorithm types, see + * JsonWebKeySignatureAlgorithm. Possible values include: 'RS256', 'RS384', + * 'RS512', 'RSNULL' + * + * @member {buffer} value + * + */ +function KeySignParameters() { +} + +/** + * Defines the metadata of KeySignParameters + * + * @returns {object} metadata of KeySignParameters + * + */ +KeySignParameters.prototype.mapper = function () { + return { + required: false, + serializedName: 'KeySignParameters', + type: { + name: 'Composite', + className: 'KeySignParameters', + modelProperties: { + algorithm: { + required: true, + serializedName: 'alg', + constraints: { + MinLength: 1 + }, + type: { + name: 'String' + } + }, + value: { + required: true, + serializedName: 'value', + type: { + name: 'Base64Url' + } + } + } + } + }; +}; + +module.exports = KeySignParameters; diff --git a/lib/services/keyVault/lib/models/keyUpdateParameters.js b/lib/services/keyVault/lib/models/keyUpdateParameters.js new file mode 100644 index 000000000..382116553 --- /dev/null +++ b/lib/services/keyVault/lib/models/keyUpdateParameters.js @@ -0,0 +1,90 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var models = require('./index'); + +var util = require('util'); + +/** + * @class + * Initializes a new instance of the KeyUpdateParameters class. + * @constructor + * The key update parameters + * + * @member {array} [keyOps] Json web key operations. For more information on + * possible key operations, see JsonWebKeyOperation. + * + * @member {object} [keyAttributes] + * + * @member {object} [tags] Application-specific metadata in the form of + * key-value pairs + * + */ +function KeyUpdateParameters() { +} + +/** + * Defines the metadata of KeyUpdateParameters + * + * @returns {object} metadata of KeyUpdateParameters + * + */ +KeyUpdateParameters.prototype.mapper = function () { + return { + required: false, + serializedName: 'KeyUpdateParameters', + type: { + name: 'Composite', + className: 'KeyUpdateParameters', + modelProperties: { + keyOps: { + required: false, + serializedName: 'key_ops', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + keyAttributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'KeyAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; +}; + +module.exports = KeyUpdateParameters; diff --git a/lib/services/keyVault/lib/models/keyVaultError.js b/lib/services/keyVault/lib/models/keyVaultError.js new file mode 100644 index 000000000..3f1fed4a5 --- /dev/null +++ b/lib/services/keyVault/lib/models/keyVaultError.js @@ -0,0 +1,59 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var models = require('./index'); + +/** + * @class + * Initializes a new instance of the KeyVaultError class. + * @constructor + * the key vault error exception + * + * @member {object} [error] + * + * @member {string} [error.code] The error code. + * + * @member {string} [error.message] The error message. + * + */ +function KeyVaultError() { +} + +/** + * Defines the metadata of KeyVaultError + * + * @returns {object} metadata of KeyVaultError + * + */ +KeyVaultError.prototype.mapper = function () { + return { + required: false, + serializedName: 'KeyVaultError', + type: { + name: 'Composite', + className: 'KeyVaultError', + modelProperties: { + error: { + required: false, + readOnly: true, + serializedName: 'error', + type: { + name: 'Composite', + className: 'ErrorModel' + } + } + } + } + }; +}; + +module.exports = KeyVaultError; diff --git a/lib/services/keyVault/lib/models/keyVerifyParameters.js b/lib/services/keyVault/lib/models/keyVerifyParameters.js new file mode 100644 index 000000000..3b85d6b75 --- /dev/null +++ b/lib/services/keyVault/lib/models/keyVerifyParameters.js @@ -0,0 +1,74 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * @class + * Initializes a new instance of the KeyVerifyParameters class. + * @constructor + * The key verify parameters + * + * @member {string} algorithm The signing/verification algorithm. For more + * information on possible algorithm types, see JsonWebKeySignatureAlgorithm. + * Possible values include: 'RS256', 'RS384', 'RS512', 'RSNULL' + * + * @member {buffer} digest The digest used for signing + * + * @member {buffer} signature The signature to be verified + * + */ +function KeyVerifyParameters() { +} + +/** + * Defines the metadata of KeyVerifyParameters + * + * @returns {object} metadata of KeyVerifyParameters + * + */ +KeyVerifyParameters.prototype.mapper = function () { + return { + required: false, + serializedName: 'KeyVerifyParameters', + type: { + name: 'Composite', + className: 'KeyVerifyParameters', + modelProperties: { + algorithm: { + required: true, + serializedName: 'alg', + constraints: { + MinLength: 1 + }, + type: { + name: 'String' + } + }, + digest: { + required: true, + serializedName: 'digest', + type: { + name: 'Base64Url' + } + }, + signature: { + required: true, + serializedName: 'value', + type: { + name: 'Base64Url' + } + } + } + } + }; +}; + +module.exports = KeyVerifyParameters; diff --git a/lib/services/keyVault/lib/models/keyVerifyResult.js b/lib/services/keyVault/lib/models/keyVerifyResult.js new file mode 100644 index 000000000..dfad2d148 --- /dev/null +++ b/lib/services/keyVault/lib/models/keyVerifyResult.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * @class + * Initializes a new instance of the KeyVerifyResult class. + * @constructor + * The key verify result + * + * @member {boolean} [value] true if the signature is verified, false + * otherwise. + * + */ +function KeyVerifyResult() { +} + +/** + * Defines the metadata of KeyVerifyResult + * + * @returns {object} metadata of KeyVerifyResult + * + */ +KeyVerifyResult.prototype.mapper = function () { + return { + required: false, + serializedName: 'KeyVerifyResult', + type: { + name: 'Composite', + className: 'KeyVerifyResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: 'value', + type: { + name: 'Boolean' + } + } + } + } + }; +}; + +module.exports = KeyVerifyResult; diff --git a/lib/services/keyVault/lib/models/lifetimeAction.js b/lib/services/keyVault/lib/models/lifetimeAction.js new file mode 100644 index 000000000..710250ce9 --- /dev/null +++ b/lib/services/keyVault/lib/models/lifetimeAction.js @@ -0,0 +1,73 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var models = require('./index'); + +/** + * @class + * Initializes a new instance of the LifetimeAction class. + * @constructor + * Action and its trigger that will be performed by Key Vault over the + * lifetime of a certificate. + * + * @member {object} [trigger] The condition that will execute the action. + * + * @member {number} [trigger.lifetimePercentage] Percentage of lifetime as + * which to trigger. Value should be between 1 and 99. + * + * @member {number} [trigger.daysBeforeExpiry] Days before expiry. + * + * @member {object} [action] The action that will be executed. + * + * @member {string} [action.actionType] The type of the action. Possible + * values include: 'EmailContacts', 'AutoRenew' + * + */ +function LifetimeAction() { +} + +/** + * Defines the metadata of LifetimeAction + * + * @returns {object} metadata of LifetimeAction + * + */ +LifetimeAction.prototype.mapper = function () { + return { + required: false, + serializedName: 'LifetimeAction', + type: { + name: 'Composite', + className: 'LifetimeAction', + modelProperties: { + trigger: { + required: false, + serializedName: 'trigger', + type: { + name: 'Composite', + className: 'Trigger' + } + }, + action: { + required: false, + serializedName: 'action', + type: { + name: 'Composite', + className: 'Action' + } + } + } + } + }; +}; + +module.exports = LifetimeAction; diff --git a/lib/services/keyVault/lib/models/organizationDetails.js b/lib/services/keyVault/lib/models/organizationDetails.js new file mode 100644 index 000000000..b217523da --- /dev/null +++ b/lib/services/keyVault/lib/models/organizationDetails.js @@ -0,0 +1,72 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var models = require('./index'); + +var util = require('util'); + +/** + * @class + * Initializes a new instance of the OrganizationDetails class. + * @constructor + * Details of the organization of the certificate issuer. + * + * @member {string} [id] Id of the organization. + * + * @member {array} [adminDetails] Details of the organization administrator. + * + */ +function OrganizationDetails() { +} + +/** + * Defines the metadata of OrganizationDetails + * + * @returns {object} metadata of OrganizationDetails + * + */ +OrganizationDetails.prototype.mapper = function () { + return { + required: false, + serializedName: 'OrganizationDetails', + type: { + name: 'Composite', + className: 'OrganizationDetails', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + adminDetails: { + required: false, + serializedName: 'admin_details', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AdministratorDetailsElementType', + type: { + name: 'Composite', + className: 'AdministratorDetails' + } + } + } + } + } + } + }; +}; + +module.exports = OrganizationDetails; diff --git a/lib/services/keyVault/lib/models/pendingCertificateSigningRequestResult.js b/lib/services/keyVault/lib/models/pendingCertificateSigningRequestResult.js new file mode 100644 index 000000000..98247efa8 --- /dev/null +++ b/lib/services/keyVault/lib/models/pendingCertificateSigningRequestResult.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * @class + * Initializes a new instance of the PendingCertificateSigningRequestResult class. + * @constructor + * The pending certificate signing request result + * + * @member {string} [value] The pending certificate signing request as Base64 + * encoded string. + * + */ +function PendingCertificateSigningRequestResult() { +} + +/** + * Defines the metadata of PendingCertificateSigningRequestResult + * + * @returns {object} metadata of PendingCertificateSigningRequestResult + * + */ +PendingCertificateSigningRequestResult.prototype.mapper = function () { + return { + required: false, + serializedName: 'PendingCertificateSigningRequestResult', + type: { + name: 'Composite', + className: 'PendingCertificateSigningRequestResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: 'value', + type: { + name: 'String' + } + } + } + } + }; +}; + +module.exports = PendingCertificateSigningRequestResult; diff --git a/lib/services/keyVault/lib/models/secretAttributes.js b/lib/services/keyVault/lib/models/secretAttributes.js new file mode 100644 index 000000000..15fa03c5b --- /dev/null +++ b/lib/services/keyVault/lib/models/secretAttributes.js @@ -0,0 +1,86 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var models = require('./index'); + +var util = require('util'); + +/** + * @class + * Initializes a new instance of the SecretAttributes class. + * @constructor + * The secret management attributes + * + */ +function SecretAttributes() { + SecretAttributes['super_'].call(this); +} + +util.inherits(SecretAttributes, models['Attributes']); + +/** + * Defines the metadata of SecretAttributes + * + * @returns {object} metadata of SecretAttributes + * + */ +SecretAttributes.prototype.mapper = function () { + return { + required: false, + serializedName: 'SecretAttributes', + type: { + name: 'Composite', + className: 'SecretAttributes', + modelProperties: { + enabled: { + required: false, + serializedName: 'enabled', + type: { + name: 'Boolean' + } + }, + notBefore: { + required: false, + serializedName: 'nbf', + type: { + name: 'UnixTime' + } + }, + expires: { + required: false, + serializedName: 'exp', + type: { + name: 'UnixTime' + } + }, + created: { + required: false, + readOnly: true, + serializedName: 'created', + type: { + name: 'UnixTime' + } + }, + updated: { + required: false, + readOnly: true, + serializedName: 'updated', + type: { + name: 'UnixTime' + } + } + } + } + }; +}; + +module.exports = SecretAttributes; diff --git a/lib/services/keyVault/lib/models/secretBundle.js b/lib/services/keyVault/lib/models/secretBundle.js new file mode 100644 index 000000000..9be105d07 --- /dev/null +++ b/lib/services/keyVault/lib/models/secretBundle.js @@ -0,0 +1,107 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var models = require('./index'); + +/** + * @class + * Initializes a new instance of the SecretBundle class. + * @constructor + * A Secret consisting of a value, id and its attributes. + * + * @member {string} [value] The secret value + * + * @member {string} [id] The secret id + * + * @member {string} [contentType] The content type of the secret + * + * @member {object} [attributes] The secret management attributes + * + * @member {object} [tags] Application-specific metadata in the form of + * key-value pairs + * + * @member {string} [kid] The key id for certificate. + * + */ +function SecretBundle() { +} + +/** + * Defines the metadata of SecretBundle + * + * @returns {object} metadata of SecretBundle + * + */ +SecretBundle.prototype.mapper = function () { + return { + required: false, + serializedName: 'SecretBundle', + type: { + name: 'Composite', + className: 'SecretBundle', + modelProperties: { + value: { + required: false, + serializedName: 'value', + type: { + name: 'String' + } + }, + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + contentType: { + required: false, + serializedName: 'contentType', + type: { + name: 'String' + } + }, + attributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'SecretAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + kid: { + required: false, + serializedName: 'kid', + type: { + name: 'String' + } + } + } + } + }; +}; + +module.exports = SecretBundle; diff --git a/lib/services/keyVault/lib/models/secretItem.js b/lib/services/keyVault/lib/models/secretItem.js new file mode 100644 index 000000000..a2909184a --- /dev/null +++ b/lib/services/keyVault/lib/models/secretItem.js @@ -0,0 +1,89 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var models = require('./index'); + +/** + * @class + * Initializes a new instance of the SecretItem class. + * @constructor + * The secret item containing secret metadata + * + * @member {string} [id] Secret Identifier + * + * @member {object} [attributes] The secret management attributes + * + * @member {object} [tags] Application-specific metadata in the form of + * key-value pairs + * + * @member {string} [contentType] Type of the secret value such as a password + * + */ +function SecretItem() { +} + +/** + * Defines the metadata of SecretItem + * + * @returns {object} metadata of SecretItem + * + */ +SecretItem.prototype.mapper = function () { + return { + required: false, + serializedName: 'SecretItem', + type: { + name: 'Composite', + className: 'SecretItem', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + attributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'SecretAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + contentType: { + required: false, + serializedName: 'contentType', + type: { + name: 'String' + } + } + } + } + }; +}; + +module.exports = SecretItem; diff --git a/lib/services/keyVault/lib/models/secretListResult.js b/lib/services/keyVault/lib/models/secretListResult.js new file mode 100644 index 000000000..278d6c03d --- /dev/null +++ b/lib/services/keyVault/lib/models/secretListResult.js @@ -0,0 +1,74 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var util = require('util'); + +/** + * @class + * Initializes a new instance of the SecretListResult class. + * @constructor + * The secret list result + * @member {array} [value] A response message containing a list of secrets in + * the vault along with a link to the next page of secrets + * + * @member {string} [nextLink] The URL to get the next set of secrets. + * + */ +function SecretListResult() { +} + +util.inherits(SecretListResult, Array); + +/** + * Defines the metadata of SecretListResult + * + * @returns {object} metadata of SecretListResult + * + */ +SecretListResult.prototype.mapper = function () { + return { + required: false, + serializedName: 'SecretListResult', + type: { + name: 'Composite', + className: 'SecretListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SecretItemElementType', + type: { + name: 'Composite', + className: 'SecretItem' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; +}; + +module.exports = SecretListResult; diff --git a/lib/services/keyVault/lib/models/secretProperties.js b/lib/services/keyVault/lib/models/secretProperties.js new file mode 100644 index 000000000..8048ede5e --- /dev/null +++ b/lib/services/keyVault/lib/models/secretProperties.js @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * @class + * Initializes a new instance of the SecretProperties class. + * @constructor + * Properties of the key backing a certificate. + * + * @member {string} [contentType] The media type (MIME type). + * + */ +function SecretProperties() { +} + +/** + * Defines the metadata of SecretProperties + * + * @returns {object} metadata of SecretProperties + * + */ +SecretProperties.prototype.mapper = function () { + return { + required: false, + serializedName: 'SecretProperties', + type: { + name: 'Composite', + className: 'SecretProperties', + modelProperties: { + contentType: { + required: false, + serializedName: 'contentType', + type: { + name: 'String' + } + } + } + } + }; +}; + +module.exports = SecretProperties; diff --git a/lib/services/keyVault/lib/models/secretSetParameters.js b/lib/services/keyVault/lib/models/secretSetParameters.js new file mode 100644 index 000000000..67256090b --- /dev/null +++ b/lib/services/keyVault/lib/models/secretSetParameters.js @@ -0,0 +1,89 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var models = require('./index'); + +/** + * @class + * Initializes a new instance of the SecretSetParameters class. + * @constructor + * The secret set parameters + * + * @member {string} value The value of the secret + * + * @member {object} [tags] Application-specific metadata in the form of + * key-value pairs + * + * @member {string} [contentType] Type of the secret value such as a password + * + * @member {object} [secretAttributes] The secret management attributes + * + */ +function SecretSetParameters() { +} + +/** + * Defines the metadata of SecretSetParameters + * + * @returns {object} metadata of SecretSetParameters + * + */ +SecretSetParameters.prototype.mapper = function () { + return { + required: false, + serializedName: 'SecretSetParameters', + type: { + name: 'Composite', + className: 'SecretSetParameters', + modelProperties: { + value: { + required: true, + serializedName: 'value', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + contentType: { + required: false, + serializedName: 'contentType', + type: { + name: 'String' + } + }, + secretAttributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'SecretAttributes' + } + } + } + } + }; +}; + +module.exports = SecretSetParameters; diff --git a/lib/services/keyVault/lib/models/secretUpdateParameters.js b/lib/services/keyVault/lib/models/secretUpdateParameters.js new file mode 100644 index 000000000..424866b9f --- /dev/null +++ b/lib/services/keyVault/lib/models/secretUpdateParameters.js @@ -0,0 +1,80 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var models = require('./index'); + +/** + * @class + * Initializes a new instance of the SecretUpdateParameters class. + * @constructor + * The secret update parameters + * + * @member {string} [contentType] Type of the secret value such as a password + * + * @member {object} [secretAttributes] The secret management attributes + * + * @member {object} [tags] Application-specific metadata in the form of + * key-value pairs + * + */ +function SecretUpdateParameters() { +} + +/** + * Defines the metadata of SecretUpdateParameters + * + * @returns {object} metadata of SecretUpdateParameters + * + */ +SecretUpdateParameters.prototype.mapper = function () { + return { + required: false, + serializedName: 'SecretUpdateParameters', + type: { + name: 'Composite', + className: 'SecretUpdateParameters', + modelProperties: { + contentType: { + required: false, + serializedName: 'contentType', + type: { + name: 'String' + } + }, + secretAttributes: { + required: false, + serializedName: 'attributes', + type: { + name: 'Composite', + className: 'SecretAttributes' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; +}; + +module.exports = SecretUpdateParameters; diff --git a/lib/services/keyVault/lib/models/subjectAlternativeNames.js b/lib/services/keyVault/lib/models/subjectAlternativeNames.js new file mode 100644 index 000000000..042947916 --- /dev/null +++ b/lib/services/keyVault/lib/models/subjectAlternativeNames.js @@ -0,0 +1,92 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var util = require('util'); + +/** + * @class + * Initializes a new instance of the SubjectAlternativeNames class. + * @constructor + * The subject alternate names of a X509 object. + * + * @member {array} [emails] Email addresses. + * + * @member {array} [dnsNames] Domain names. + * + * @member {array} [upns] User principal names. + * + */ +function SubjectAlternativeNames() { +} + +/** + * Defines the metadata of SubjectAlternativeNames + * + * @returns {object} metadata of SubjectAlternativeNames + * + */ +SubjectAlternativeNames.prototype.mapper = function () { + return { + required: false, + serializedName: 'SubjectAlternativeNames', + type: { + name: 'Composite', + className: 'SubjectAlternativeNames', + modelProperties: { + emails: { + required: false, + serializedName: 'emails', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + dnsNames: { + required: false, + serializedName: 'dns_names', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + upns: { + required: false, + serializedName: 'upns', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; +}; + +module.exports = SubjectAlternativeNames; diff --git a/lib/services/keyVault/lib/models/trigger.js b/lib/services/keyVault/lib/models/trigger.js new file mode 100644 index 000000000..c35b28f67 --- /dev/null +++ b/lib/services/keyVault/lib/models/trigger.js @@ -0,0 +1,65 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * @class + * Initializes a new instance of the Trigger class. + * @constructor + * A condition to be satisfied for an action to be executed. + * + * @member {number} [lifetimePercentage] Percentage of lifetime as which to + * trigger. Value should be between 1 and 99. + * + * @member {number} [daysBeforeExpiry] Days before expiry. + * + */ +function Trigger() { +} + +/** + * Defines the metadata of Trigger + * + * @returns {object} metadata of Trigger + * + */ +Trigger.prototype.mapper = function () { + return { + required: false, + serializedName: 'Trigger', + type: { + name: 'Composite', + className: 'Trigger', + modelProperties: { + lifetimePercentage: { + required: false, + serializedName: 'lifetime_percentage', + constraints: { + InclusiveMaximum: 99, + InclusiveMinimum: 1 + }, + type: { + name: 'Number' + } + }, + daysBeforeExpiry: { + required: false, + serializedName: 'days_before_expiry', + type: { + name: 'Number' + } + } + } + } + }; +}; + +module.exports = Trigger; diff --git a/lib/services/keyVault/lib/models/x509CertificateProperties.js b/lib/services/keyVault/lib/models/x509CertificateProperties.js new file mode 100644 index 000000000..980a55f72 --- /dev/null +++ b/lib/services/keyVault/lib/models/x509CertificateProperties.js @@ -0,0 +1,116 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var models = require('./index'); + +var util = require('util'); + +/** + * @class + * Initializes a new instance of the X509CertificateProperties class. + * @constructor + * Properties of the X509 component of a certificate. + * + * @member {string} [subject] The subject name. Should be a valid X509 + * Distinguished Name. + * + * @member {array} [ekus] The enhaunced key usage. + * + * @member {object} [subjectAlternativeNames] The subject alternative names. + * + * @member {array} [subjectAlternativeNames.emails] Email addresses. + * + * @member {array} [subjectAlternativeNames.dnsNames] Domain names. + * + * @member {array} [subjectAlternativeNames.upns] User principal names. + * + * @member {array} [keyUsage] List of key usages. + * + * @member {number} [validityInMonths] The subject alternate names. + * + */ +function X509CertificateProperties() { +} + +/** + * Defines the metadata of X509CertificateProperties + * + * @returns {object} metadata of X509CertificateProperties + * + */ +X509CertificateProperties.prototype.mapper = function () { + return { + required: false, + serializedName: 'X509CertificateProperties', + type: { + name: 'Composite', + className: 'X509CertificateProperties', + modelProperties: { + subject: { + required: false, + serializedName: 'subject', + type: { + name: 'String' + } + }, + ekus: { + required: false, + serializedName: 'ekus', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + subjectAlternativeNames: { + required: false, + serializedName: 'sans', + type: { + name: 'Composite', + className: 'SubjectAlternativeNames' + } + }, + keyUsage: { + required: false, + serializedName: 'key_usage', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + validityInMonths: { + required: false, + serializedName: 'validity_months', + constraints: { + InclusiveMinimum: 0 + }, + type: { + name: 'Number' + } + } + } + } + }; +}; + +module.exports = X509CertificateProperties; diff --git a/lib/services/keyVault/lib/objectIdentifier.js b/lib/services/keyVault/lib/objectIdentifier.js new file mode 100644 index 000000000..ae0b560be --- /dev/null +++ b/lib/services/keyVault/lib/objectIdentifier.js @@ -0,0 +1,221 @@ +var url = require('url'); +var util = require('util'); + + +/** An identifier for an Azure Key Vault resource. + * @class + */ +function ObjectIdentifier(collection, vault, name, version) { + + /** The vault URI. + * @member {string} + */ + this.vault = vault; + + /** The key name. + * @member {string} + */ + this.name = name; + + /** The key version. May be null. + * @member {string} + */ + this.version = version; + + /** The base identifier (i.e. without the version). + * @member {string} + */ + this.baseIdentifier = util.format('%s/%s/%s', vault, collection, name); + + /** The full identifier if a version was informed; otherwise is the same value of baseIdentifier. + * @member {string} + */ + this.identifier = version ? util.format('%s/%s', this.baseIdentifier, version) : this.baseIdentifier; +} + +function createObjectIdentifier(collection, vault, name, version) { + + if (typeof collection != 'string' || !(collection = collection.trim())) { + throw new Error('Invalid collection argument'); + } + + if (typeof vault != 'string' || !(vault = vault.trim())) { + throw new Error('Invalid vault argument'); + } + + if (typeof name != 'string' || !(name = name.trim())) { + throw new Error('Invalid name argument'); + } + + if (version && typeof version != 'string') { + throw new Error('Invalid version argument'); + } + + if (version) { + version = version.trim(); + } + + if (!version) { + version = null; + } + + var baseUri; + try { + baseUri = url.parse(vault, true, true); + } catch (e) { + throw new Error(util.format('Invalid %s identifier: %s. Not a valid URI', collection, vault)); + } + + var vault = util.format('%s//%s', baseUri.protocol, baseUri.host); + return new ObjectIdentifier(collection, vault, name, version); +} + +function parseObjectIdentifier(collection, identifier) { + + if (typeof collection != 'string' || !(collection = collection.trim())) { + throw new Error('Invalid collection argument'); + } + + if (typeof identifier != 'string' || !(identifier = identifier.trim())) { + throw new Error('Invalid identifier argument'); + } + + var baseUri; + try { + baseUri = url.parse(identifier, true, true); + } catch (e) { + throw new Error(util.format('Invalid %s identifier: %s. Not a valid URI', collection, identifier)); + } + + // Path is of the form '/collection/name[/version]' + var segments = baseUri.pathname.split('/'); + if (segments.length !== 3 && segments.length !== 4) { + throw new Error(util.format('Invalid %s identifier: %s. Bad number of segments: %d', collection, identifier, segments.length)); + } + + if (collection !== segments[1]) { + throw new Error(util.format('Invalid %s identifier: %s. segment [1] should be "%s", found "%s"', collection, identifier, collection, segments[1])); + } + + var vault = util.format('%s//%s', baseUri.protocol, baseUri.host); + var name = segments[2]; + var version = segments.length === 4 ? segments[3] : null; + return new ObjectIdentifier(collection, vault, name, version); +} + +/** Creates an ObjectIdentifier object for a key. + @param {string} vault The vault URI. + @param {string} name The key name. + @param {string} [version=null] The object version. + @return {ObjectIdentifier} An object that represents the key identifier. +*/ +module.exports.createKeyIdentifier = function (vault, name, version) { + return createObjectIdentifier('keys', vault, name, version); +}; + +/** Parses a string containing a key identifier and returns the ObjectIdentifier object. + @param {string} identifier The key identifier (an URI). + @return {ObjectIdentifier} An object that represents the key identifier. +*/ +module.exports.parseKeyIdentifier = function (identifier) { + return parseObjectIdentifier('keys', identifier); +}; + +/** Creates an ObjectIdentifier object for a secret. + @param {string} vault The vault URI. + @param {string} name The secret name. + @param {string} [version=null] The object version. + @return {ObjectIdentifier} An object that represents the secret identifier. +*/ +module.exports.createSecretIdentifier = function (vault, name, version) { + return createObjectIdentifier('secrets', vault, name, version); +}; + +/** Parses a string containing a secret identifier and returns the ObjectIdentifier object. + @param {string} identifier The secret identifier (an URI). + @return {ObjectIdentifier} An object that represents the secret identifier. +*/ +module.exports.parseSecretIdentifier = function (identifier) { + return parseObjectIdentifier('secrets', identifier); +}; + +/** Creates an ObjectIdentifier object for a certificate. + @param {string} vault The vault URI. + @param {string} name The certificate name. + @param {string} [version=null] The object version. + @return {ObjectIdentifier} An object that represents the certificate identifier. +*/ +module.exports.createCertificateIdentifier = function (vault, name, version) { + return createObjectIdentifier('certificates', vault, name, version); +}; + +/** Parses a string containing a certificate identifier and returns the ObjectIdentifier object. + @param {string} identifier The certificate identifier (an URI). + @return {ObjectIdentifier} An object that represents the certificate identifier. +*/ +module.exports.parseCertificateIdentifier = function (identifier) { + return parseObjectIdentifier('certificates', identifier); +}; + +/** Creates an ObjectIdentifier object for a certificate operation. + @param {string} vault The vault URI. + @param {string} name The certificate name. + @return {ObjectIdentifier} An object that represents the certificate identifier. +*/ +module.exports.createCertificateOperationIdentifier = function (vault, name) { + var objId = createObjectIdentifier('certificates', vault, name, 'pending'); + objId.baseIdentifier = objId.identifier; + objId.version = null; + return objId; +}; + +/** Parses a string containing a certificate identifier and returns the ObjectIdentifier object. + @param {string} identifier The certificate identifier (an URI). + @return {ObjectIdentifier} An object that represents the certificate identifier. +*/ +module.exports.parseCertificateOperationIdentifier = function (identifier) { + var objId = parseObjectIdentifier('certificates', identifier); + objId.baseIdentifier = objId.identifier; + objId.version = null; + return objId; +}; + +/** Creates an ObjectIdentifier object for a certificate issuer. + @param {string} vault The vault URI. + @param {string} name The certificate issuer name. + @return {ObjectIdentifier} An object that represents the certificate issuer identifier. +*/ +module.exports.createIssuerIdentifier = function (vault, name) { + return createObjectIdentifier('certificates/issuers', vault, name); +}; + +/** Parses a string containing a certificate issuer identifier and returns the ObjectIdentifier object. + @param {string} identifier The certificate issuer identifier (an URI). + @return {ObjectIdentifier} An object that represents the certificate issuer identifier. +*/ +module.exports.parseIssuerIdentifier = function (identifier) { + var baseUri; + try { + baseUri = url.parse(identifier, true, true); + } catch (e) { + throw new Error(util.format('Invalid %s identifier: %s. Not a valid URI', 'issuer', identifier)); + } + + // Path is of the form '/certificate/issuer/name' + var segments = baseUri.pathname.split('/'); + if (segments.length !== 4) { + throw new Error(util.format('Invalid %s identifier: %s. Bad number of segments: %d', 'issuer', identifier, segments.length)); + } + + if ('certificates' !== segments[1]) { + throw new Error(util.format('Invalid %s identifier: %s. segment [1] should be "%s", found "%s"', 'issuer', identifier, 'certificates', segments[1])); + } + + if ('issuers' !== segments[2]) { + throw new Error(util.format('Invalid %s identifier: %s. segment [2] should be "%s", found "%s"', 'issuer', identifier, 'issuers', segments[1])); + } + + var vault = util.format('%s//%s', baseUri.protocol, baseUri.host); + var name = segments[3]; + return new ObjectIdentifier('certificates/issuers', vault, name, null); +}; \ No newline at end of file diff --git a/lib/services/keyVault/package.json b/lib/services/keyVault/package.json index c53b00284..c8f86a847 100644 --- a/lib/services/keyVault/package.json +++ b/lib/services/keyVault/package.json @@ -6,10 +6,11 @@ "Gupta, Divya ", "Kostal, Greg ", "Wilson, Hervey ", + "Mortazavi, Pooneh ", "Zavery, Amar ", "Wang, Yugang " ], - "version": "0.10.1", + "version": "0.10.2", "description": "Microsoft Azure Key Vault Client Library for node", "tags": [ "azure", @@ -27,9 +28,9 @@ } ], "dependencies": { - "azure-common": "^0.9.13", - "node-uuid": ">= 1.3.3", - "underscore": "1.4.x" + "ms-rest": "^1.14.0", + "ms-rest-azure": "^1.14.0", + "underscore": "^1.4.0" }, "homepage": "http://github.com/Azure/azure-sdk-for-node", "repository": { diff --git a/lib/services/keyVaultManagement/README.md b/lib/services/keyVaultManagement/README.md index 423f5f768..abd913ede 100644 --- a/lib/services/keyVaultManagement/README.md +++ b/lib/services/keyVaultManagement/README.md @@ -1,8 +1,8 @@ # Microsoft Azure SDK for Node.js - Key Vault Management This project provides a Node.js package for managing vaults on Azure Key Vault. Right now it supports: -- **Node.js version: 0.6.15 or higher** -- **Resource Management REST API version: 2014-12-19-PREVIEW** +- **Node.js version: 4.x.x or higher** +- **REST API version: 2015-06-01** ## Features @@ -19,33 +19,19 @@ npm install azure-arm-keyvault The following example creates a new vault. ```javascript -var AzureCommon = require('azure-common'); -var AzureMgmtKeyVault = require('azure-arm-keyvault'); -var AdalNode = require('adal-node'); // Used for authentication +var msRestAzure = require('ms-rest-azure'); +var keyVaultManagementClient = require('azure-arm-keyvault'); -var userName = 'someone@myorg.com'; -var password = '123'; -var clientId = ''; -var resourceUri = 'https://management.core.windows.net/'; +// Interactive Login +msRestAzure.interactiveLogin(function(err, credentials) { + var client = new keyVaultManagementClient(credentials, ''); -var context = new AdalNode.AuthenticationContext('https://login.windows.net/myorg.com'); -context.acquireTokenWithUsernamePassword(resourceId, userName, password, clientId, function (err, response) { - if (err) { - throw new Error('Unable to authenticate: ' + err.stack); - } - - var credentials = new AzureCommon.TokenCloudCredentials({ - subscriptionId : '', - authorizationScheme : response.tokenType, - token : response.accessToken + client.vaults.list(function(err, result) { + if (err) console.log(err); + console.log(result); }); - - // Creates an Azure Key Vault Management client. - // The Azure Resource Manager URI must also be passed to this constructor for the - // China, Germany, and US Government Azure environments - client = new AzureMgmtKeyVault.KeyVaultManagementClient(credentials); - - var resourceGroup = 'myResourceGroup'; + + var resourceGroup = ''; var vaultName = 'myNewVault'; var parameters = { location : "East US", @@ -59,18 +45,17 @@ context.acquireTokenWithUsernamePassword(resourceId, userName, password, clientI tenantId : '' }, tags : {} - }; - + }; + console.info('Creating vault...'); client.vaults.createOrUpdate(resourceGroup, vaultName, parameters, function (err, result) { if (err) throw err; - console.info('Vault created: ' + JSON.stringify(result, null, ' ')); + console.log(result); }); - }); ``` ## Related projects -- [Microsoft Azure SDK for Node.js](https://github.com/WindowsAzure/azure-sdk-for-node) -- [Microsoft Azure SDK for Node.js - Key Vault](https://github.com/WindowsAzure/azure-keyvault-for-node) +- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) +- [Microsoft Azure SDK for Node.js - Key Vault](https://github.com/Azure/azure-sdk-for-node/tree/master/lib/services/keyVault) diff --git a/lib/services/keyVaultManagement/lib/keyVault.js b/lib/services/keyVaultManagement/lib/keyVault.js deleted file mode 100644 index b35de1551..000000000 --- a/lib/services/keyVaultManagement/lib/keyVault.js +++ /dev/null @@ -1,19 +0,0 @@ -// -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// - -var exports = module.exports; - -exports.KeyVaultManagementClient = require('./keyVaultManagementClient').KeyVaultManagementClient; diff --git a/lib/services/keyVaultManagement/lib/keyVaultManagementClient.d.ts b/lib/services/keyVaultManagement/lib/keyVaultManagementClient.d.ts new file mode 100644 index 000000000..678ab005a --- /dev/null +++ b/lib/services/keyVaultManagement/lib/keyVaultManagementClient.d.ts @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import { ServiceClientOptions, RequestOptions, ServiceCallback, ServiceClientCredentials } from 'ms-rest'; +import * as operations from "./operations"; + +declare class KeyVaultManagementClient { + /** + * @class + * Initializes a new instance of the KeyVaultManagementClient class. + * @constructor + * + * @param {credentials} credentials - Credentials needed for the client to connect to Azure. + * + * @param {string} subscriptionId - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param {string} [baseUri] - The base URI of the service. + * + * @param {object} [options] - The parameter options + * + * @param {Array} [options.filters] - Filters to be added to the request pipeline + * + * @param {object} [options.requestOptions] - Options for the underlying request object + * {@link https://github.com/request/request#requestoptions-callback Options doc} + * + * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy + * + * @param {string} [options.apiVersion] - Client Api Version. + * + * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. + * + * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + */ + constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri: string, options: ServiceClientOptions); + + credentials: ServiceClientCredentials; + + subscriptionId: string; + + apiVersion: string; + + acceptLanguage: string; + + longRunningOperationRetryTimeout: number; + + generateClientRequestId: boolean; + + // Operation groups + vaults: operations.Vaults; + } + +export = KeyVaultManagementClient; diff --git a/lib/services/keyVaultManagement/lib/keyVaultManagementClient.js b/lib/services/keyVaultManagement/lib/keyVaultManagementClient.js index 263b24859..c950cb724 100644 --- a/lib/services/keyVaultManagement/lib/keyVaultManagementClient.js +++ b/lib/services/keyVaultManagement/lib/keyVaultManagementClient.js @@ -1,1102 +1,95 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + /* jshint latedef:false */ /* jshint forin:false */ /* jshint noempty:false */ -// -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// - -// Warning: This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if the -// code is regenerated. - 'use strict'; var util = require('util'); -var azureCommon = require('azure-common'); -var Service = azureCommon.Service; -var WebResource = azureCommon.WebResource; +var msRest = require('ms-rest'); +var msRestAzure = require('ms-rest-azure'); +var ServiceClient = msRestAzure.AzureServiceClient; -var KeyVaultManagementClient = ( /** @lends KeyVaultManagementClient */ function() { - /** - * @class - * The Windows Azure management API provides a RESTful set of web services - * that interact with Azure Key Vault. - * Initializes a new instance of the KeyVaultManagementClient class. - * @constructor - * - * @param {SubscriptionCloudCredentials} credentials Gets subscription - * credentials which uniquely identify Microsoft Azure subscription. The - * subscription ID forms part of the URI for every service call. - * - * @param {string} [credentials.subscriptionId] - * - * @param {string} [baseUri] Gets the URI used as the base for all cloud - * service requests. - * - * @param {Array} filters - */ - function KeyVaultManagementClient(credentials, baseUri, filters) { - if (credentials === null || credentials === undefined) { - throw new Error('credentials cannot be null.'); - } - - KeyVaultManagementClient['super_'].call(this, credentials, filters); - - this.credentials = credentials; - this.baseUri = baseUri; - if (this.baseUri === null || this.baseUri === undefined) { - this.baseUri = 'https://management.azure.com'; - } - if (this.apiVersion === null || this.apiVersion === undefined) { - this.apiVersion = '2014-04-01'; - } - if (this.longRunningOperationInitialTimeout === null || this.longRunningOperationInitialTimeout === undefined) { - this.longRunningOperationInitialTimeout = -1; - } - if (this.longRunningOperationRetryTimeout === null || this.longRunningOperationRetryTimeout === undefined) { - this.longRunningOperationRetryTimeout = -1; - } - /** - * Provides an instance of the [VaultOperations](-VaultOperations.html) - * object. - * @type {object} - */ - this.vaults = new VaultOperations(this); - } - - util.inherits(KeyVaultManagementClient, Service); - - - return KeyVaultManagementClient; -})(); -exports.KeyVaultManagementClient = KeyVaultManagementClient; +var models = require('./models'); +var operations = require('./operations'); -var VaultOperations = ( /** @lends VaultOperations */ function() { - /** - * @class - * Vault operations - * __NOTE__: An instance of this class is automatically created for an - * instance of the [KeyVaultManagementClient] {@link - * KeyVaultManagementClient~KeyVaultManagementClient}. - * See [vaults] {@link - * KeyVaultManagementClient~KeyVaultManagementClient#vaults}. - * Initializes a new instance of the VaultOperations class. - * @constructor - * - * @param {KeyVaultManagementClient} client Reference to the service client. - */ - function VaultOperations(client) { - this.client = client; +/** + * @class + * Initializes a new instance of the KeyVaultManagementClient class. + * @constructor + * + * @param {credentials} credentials - Credentials needed for the client to connect to Azure. + * + * @param {string} subscriptionId - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param {string} [baseUri] - The base URI of the service. + * + * @param {object} [options] - The parameter options + * + * @param {Array} [options.filters] - Filters to be added to the request pipeline + * + * @param {object} [options.requestOptions] - Options for the underlying request object + * {@link https://github.com/request/request#requestoptions-callback Options doc} + * + * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy + * + * @param {string} [options.apiVersion] - Client Api Version. + * + * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. + * + * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + */ +function KeyVaultManagementClient(credentials, subscriptionId, baseUri, options) { + this.apiVersion = '2015-06-01'; + this.acceptLanguage = 'en-US'; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + if (credentials === null || credentials === undefined) { + throw new Error('\'credentials\' cannot be null.'); } - - /** - * Creates a new Azure key vault. - * - * @param {string} resourceGroupName The name of the Resource Group to which - * the server belongs. - * - * @param {string} vaultName - * - * @param {VaultCreateOrUpdateParameters} parameters - * - * @param {VaultProperties} parameters.properties Gets or sets the location - * of the resource. - * - * @param {string} [parameters.properties.vaultUri] - * - * @param {Guid} [parameters.properties.tenantId] - * - * @param {Sku} [parameters.properties.sku] - * - * @param {string} [parameters.properties.sku.family] - * - * @param {string} [parameters.properties.sku.name] - * - * @param {AccessPolicyEntry[]} [parameters.properties.accessPolicies] - * - * @param {boolean} [parameters.properties.enabledForDeployment] - * - * @param {string} parameters.location Gets or sets the location of the - * resource. - * - * @param {object} parameters.tags Gets or sets the tags associated with the - * request. - * - * @param {function} callback - * - * @returns {Stream} The response stream. - */ - VaultOperations.prototype.createOrUpdate = function(resourceGroupName, vaultName, parameters, callback) { - if (callback === null || callback === undefined) { - throw new Error('callback cannot be null.'); - } - // Validate - if (resourceGroupName === null || resourceGroupName === undefined) { - return callback(new Error('resourceGroupName cannot be null.')); - } - if (vaultName === null || vaultName === undefined) { - return callback(new Error('vaultName cannot be null.')); - } - if (parameters === null || parameters === undefined) { - return callback(new Error('parameters cannot be null.')); - } - if (parameters.location === null || parameters.location === undefined) { - return callback(new Error('parameters.location cannot be null.')); - } - if (parameters.properties === null || parameters.properties === undefined) { - return callback(new Error('parameters.properties cannot be null.')); - } - if (parameters.tags === null || parameters.tags === undefined) { - return callback(new Error('parameters.tags cannot be null.')); - } - - // Tracing - - // Construct URL - var url2 = ''; - url2 = url2 + '/subscriptions/'; - if (this.client.credentials.subscriptionId !== null && this.client.credentials.subscriptionId !== undefined) { - url2 = url2 + encodeURIComponent(this.client.credentials.subscriptionId); - } - url2 = url2 + '/resourceGroups/'; - url2 = url2 + encodeURIComponent(resourceGroupName); - url2 = url2 + '/providers/'; - url2 = url2 + 'Microsoft.KeyVault'; - url2 = url2 + '/vaults/'; - url2 = url2 + encodeURIComponent(vaultName); - var queryParameters = []; - queryParameters.push('api-version=2015-06-01'); - if (queryParameters.length > 0) { - url2 = url2 + '?' + queryParameters.join('&'); - } - var baseUrl = this.client.baseUri; - // Trim '/' character from the end of baseUrl and beginning of url. - if (baseUrl[baseUrl.length - 1] === '/') { - baseUrl = baseUrl.substring(0, (baseUrl.length - 1) + 0); - } - if (url2[0] === '/') { - url2 = url2.substring(1); - } - url2 = baseUrl + '/' + url2; - url2 = url2.replace(' ', '%20'); - - // Create HTTP transport objects - var httpRequest = new WebResource(); - httpRequest.method = 'PUT'; - httpRequest.headers = {}; - httpRequest.url = url2; - - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - - // Serialize Request - var requestContent = null; - var requestDoc = null; - - var vaultCreateOrUpdateParametersValue = {}; - requestDoc = vaultCreateOrUpdateParametersValue; - - var propertiesValue = {}; - vaultCreateOrUpdateParametersValue['properties'] = propertiesValue; - - if (parameters.properties.vaultUri !== null && parameters.properties.vaultUri !== undefined) { - propertiesValue['vaultUri'] = parameters.properties.vaultUri; - } - - if (parameters.properties.tenantId !== null && parameters.properties.tenantId !== undefined) { - propertiesValue['tenantId'] = parameters.properties.tenantId; - } - - if (parameters.properties.sku !== null && parameters.properties.sku !== undefined) { - var skuValue = {}; - propertiesValue['sku'] = skuValue; - - if (parameters.properties.sku.family !== null && parameters.properties.sku.family !== undefined) { - skuValue['family'] = parameters.properties.sku.family; - } - - if (parameters.properties.sku.name !== null && parameters.properties.sku.name !== undefined) { - skuValue['name'] = parameters.properties.sku.name; - } - } - - if (parameters.properties.accessPolicies !== null && parameters.properties.accessPolicies !== undefined) { - var accessPoliciesArray = []; - for (var loweredIndex1 = 0; loweredIndex1 < parameters.properties.accessPolicies.length; loweredIndex1 = loweredIndex1 + 1) { - var accessPoliciesItem = parameters.properties.accessPolicies[loweredIndex1]; - var accessPolicyEntryValue = {}; - accessPoliciesArray.push(accessPolicyEntryValue); - - if (accessPoliciesItem.tenantId !== null && accessPoliciesItem.tenantId !== undefined) { - accessPolicyEntryValue['tenantId'] = accessPoliciesItem.tenantId; - } - - if (accessPoliciesItem.objectId !== null && accessPoliciesItem.objectId !== undefined) { - accessPolicyEntryValue['objectId'] = accessPoliciesItem.objectId; - } - - if (accessPoliciesItem.permissions !== null && accessPoliciesItem.permissions !== undefined) { - accessPolicyEntryValue['permissions'] = accessPoliciesItem.permissions; - } - } - propertiesValue['accessPolicies'] = accessPoliciesArray; - } - - if (parameters.properties.enabledForDeployment !== null && parameters.properties.enabledForDeployment !== undefined) { - propertiesValue['enabledForDeployment'] = parameters.properties.enabledForDeployment; - } - - vaultCreateOrUpdateParametersValue['location'] = parameters.location; - - if (parameters.tags !== null && parameters.tags !== undefined) { - var tagsDictionary = {}; - for (var tagsKey in parameters.tags) { - var tagsValue = parameters.tags[tagsKey]; - tagsDictionary[tagsKey] = tagsValue; - } - vaultCreateOrUpdateParametersValue['tags'] = tagsDictionary; - } - - requestContent = JSON.stringify(requestDoc); - httpRequest.body = requestContent; - httpRequest.headers['Content-Length'] = Buffer.isBuffer(requestContent) ? requestContent.length : Buffer.byteLength(requestContent, 'UTF8'); - // Send Request - return this.client.pipeline(httpRequest, function (err, response, body) { - if (err !== null && err !== undefined) { - return callback(err); - } - var statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { - var error = new Error(body); - error.statusCode = response.statusCode; - return callback(error); - } - - // Create Result - var result = null; - // Deserialize Response - if (statusCode === 200 || statusCode === 201) { - var responseContent = body; - result = {}; - var responseDoc = null; - if (responseContent) { - responseDoc = JSON.parse(responseContent); - } - - if (responseDoc !== null && responseDoc !== undefined) { - var vaultInstance = { tags: {} }; - result.vault = vaultInstance; - - var propertiesValue2 = responseDoc['properties']; - if (propertiesValue2 !== null && propertiesValue2 !== undefined) { - var propertiesInstance = { accessPolicies: [] }; - vaultInstance.properties = propertiesInstance; - - var vaultUriValue = propertiesValue2['vaultUri']; - if (vaultUriValue !== null && vaultUriValue !== undefined) { - var vaultUriInstance = vaultUriValue; - propertiesInstance.vaultUri = vaultUriInstance; - } - - var tenantIdValue = propertiesValue2['tenantId']; - if (tenantIdValue !== null && tenantIdValue !== undefined) { - var tenantIdInstance = tenantIdValue; - propertiesInstance.tenantId = tenantIdInstance; - } - - var skuValue2 = propertiesValue2['sku']; - if (skuValue2 !== null && skuValue2 !== undefined) { - var skuInstance = {}; - propertiesInstance.sku = skuInstance; - - var familyValue = skuValue2['family']; - if (familyValue !== null && familyValue !== undefined) { - var familyInstance = familyValue; - skuInstance.family = familyInstance; - } - - var nameValue = skuValue2['name']; - if (nameValue !== null && nameValue !== undefined) { - var nameInstance = nameValue; - skuInstance.name = nameInstance; - } - } - - var accessPoliciesArray2 = propertiesValue2['accessPolicies']; - if (accessPoliciesArray2 !== null && accessPoliciesArray2 !== undefined) { - for (var loweredIndex2 = 0; loweredIndex2 < accessPoliciesArray2.length; loweredIndex2 = loweredIndex2 + 1) { - var accessPoliciesValue = accessPoliciesArray2[loweredIndex2]; - var accessPolicyEntryInstance = {}; - propertiesInstance.accessPolicies.push(accessPolicyEntryInstance); - - var tenantIdValue2 = accessPoliciesValue['tenantId']; - if (tenantIdValue2 !== null && tenantIdValue2 !== undefined) { - var tenantIdInstance2 = tenantIdValue2; - accessPolicyEntryInstance.tenantId = tenantIdInstance2; - } - - var objectIdValue = accessPoliciesValue['objectId']; - if (objectIdValue !== null && objectIdValue !== undefined) { - var objectIdInstance = objectIdValue; - accessPolicyEntryInstance.objectId = objectIdInstance; - } - - var permissionsValue = accessPoliciesValue['permissions']; - if (permissionsValue !== null && permissionsValue !== undefined) { - var permissionsInstance = permissionsValue; - accessPolicyEntryInstance.permissions = permissionsInstance; - } - } - } - - var enabledForDeploymentValue = propertiesValue2['enabledForDeployment']; - if (enabledForDeploymentValue !== null && enabledForDeploymentValue !== undefined) { - var enabledForDeploymentInstance = enabledForDeploymentValue; - propertiesInstance.enabledForDeployment = enabledForDeploymentInstance; - } - } - - var idValue = responseDoc['id']; - if (idValue !== null && idValue !== undefined) { - var idInstance = idValue; - vaultInstance.id = idInstance; - } - - var nameValue2 = responseDoc['name']; - if (nameValue2 !== null && nameValue2 !== undefined) { - var nameInstance2 = nameValue2; - vaultInstance.name = nameInstance2; - } - - var locationValue = responseDoc['location']; - if (locationValue !== null && locationValue !== undefined) { - var locationInstance = locationValue; - vaultInstance.location = locationInstance; - } - - var tagsSequenceElement = responseDoc['tags']; - if (tagsSequenceElement !== null && tagsSequenceElement !== undefined) { - for (var property in tagsSequenceElement) { - var tagsKey2 = property; - var tagsValue2 = tagsSequenceElement[property]; - vaultInstance.tags[tagsKey2] = tagsValue2; - } - } - - var typeValue = responseDoc['type']; - if (typeValue !== null && typeValue !== undefined) { - var typeInstance = typeValue; - vaultInstance.type = typeInstance; - } - } - - } - result.statusCode = statusCode; - result.requestId = response.headers['x-ms-request-id']; - - return callback(null, result); - }); - }; - - /** - * Creates a new Azure key vault. - * - * @param {string} resourceGroupName The name of the Resource Group to which - * the server belongs. - * - * @param {string} vaultName - * - * @param {function} callback - * - * @returns {Stream} The response stream. - */ - VaultOperations.prototype.deleteMethod = function(resourceGroupName, vaultName, callback) { - if (callback === null || callback === undefined) { - throw new Error('callback cannot be null.'); - } - // Validate - if (resourceGroupName === null || resourceGroupName === undefined) { - return callback(new Error('resourceGroupName cannot be null.')); - } - if (vaultName === null || vaultName === undefined) { - return callback(new Error('vaultName cannot be null.')); - } - - // Tracing - - // Construct URL - var url2 = ''; - url2 = url2 + '/subscriptions/'; - if (this.client.credentials.subscriptionId !== null && this.client.credentials.subscriptionId !== undefined) { - url2 = url2 + encodeURIComponent(this.client.credentials.subscriptionId); - } - url2 = url2 + '/resourceGroups/'; - url2 = url2 + encodeURIComponent(resourceGroupName); - url2 = url2 + '/providers/'; - url2 = url2 + 'Microsoft.KeyVault'; - url2 = url2 + '/vaults/'; - url2 = url2 + encodeURIComponent(vaultName); - var queryParameters = []; - queryParameters.push('api-version=2015-06-01'); - if (queryParameters.length > 0) { - url2 = url2 + '?' + queryParameters.join('&'); - } - var baseUrl = this.client.baseUri; - // Trim '/' character from the end of baseUrl and beginning of url. - if (baseUrl[baseUrl.length - 1] === '/') { - baseUrl = baseUrl.substring(0, (baseUrl.length - 1) + 0); - } - if (url2[0] === '/') { - url2 = url2.substring(1); - } - url2 = baseUrl + '/' + url2; - url2 = url2.replace(' ', '%20'); - - // Create HTTP transport objects - var httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; - httpRequest.headers = {}; - httpRequest.url = url2; - - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - - // Send Request - return this.client.pipeline(httpRequest, function (err, response, body) { - if (err !== null && err !== undefined) { - return callback(err); - } - var statusCode = response.statusCode; - if (statusCode !== 200) { - var error = new Error(body); - error.statusCode = response.statusCode; - return callback(error); - } - - // Create Result - var result = null; - // Deserialize Response - result = {}; - result.statusCode = statusCode; - result.requestId = response.headers['x-ms-request-id']; - - return callback(null, result); - }); - }; - - /** - * Creates a new Azure key vault. - * - * @param {string} resourceGroupName The name of the Resource Group to which - * the vault belongs. - * - * @param {string} vaultName - * - * @param {function} callback - * - * @returns {Stream} The response stream. - */ - VaultOperations.prototype.get = function(resourceGroupName, vaultName, callback) { - if (callback === null || callback === undefined) { - throw new Error('callback cannot be null.'); - } - // Validate - if (resourceGroupName === null || resourceGroupName === undefined) { - return callback(new Error('resourceGroupName cannot be null.')); - } - if (vaultName === null || vaultName === undefined) { - return callback(new Error('vaultName cannot be null.')); - } - - // Tracing - - // Construct URL - var url2 = ''; - url2 = url2 + '/subscriptions/'; - if (this.client.credentials.subscriptionId !== null && this.client.credentials.subscriptionId !== undefined) { - url2 = url2 + encodeURIComponent(this.client.credentials.subscriptionId); - } - url2 = url2 + '/resourceGroups/'; - url2 = url2 + encodeURIComponent(resourceGroupName); - url2 = url2 + '/providers/'; - url2 = url2 + 'Microsoft.KeyVault'; - url2 = url2 + '/vaults/'; - url2 = url2 + encodeURIComponent(vaultName); - var queryParameters = []; - queryParameters.push('api-version=2015-06-01'); - if (queryParameters.length > 0) { - url2 = url2 + '?' + queryParameters.join('&'); - } - var baseUrl = this.client.baseUri; - // Trim '/' character from the end of baseUrl and beginning of url. - if (baseUrl[baseUrl.length - 1] === '/') { - baseUrl = baseUrl.substring(0, (baseUrl.length - 1) + 0); - } - if (url2[0] === '/') { - url2 = url2.substring(1); - } - url2 = baseUrl + '/' + url2; - url2 = url2.replace(' ', '%20'); - - // Create HTTP transport objects - var httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.headers = {}; - httpRequest.url = url2; - - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - - // Send Request - return this.client.pipeline(httpRequest, function (err, response, body) { - if (err !== null && err !== undefined) { - return callback(err); - } - var statusCode = response.statusCode; - if (statusCode !== 200) { - var error = new Error(body); - error.statusCode = response.statusCode; - return callback(error); - } - - // Create Result - var result = null; - // Deserialize Response - if (statusCode === 200) { - var responseContent = body; - result = {}; - var responseDoc = null; - if (responseContent) { - responseDoc = JSON.parse(responseContent); - } - - if (responseDoc !== null && responseDoc !== undefined) { - var vaultInstance = { tags: {} }; - result.vault = vaultInstance; - - var propertiesValue = responseDoc['properties']; - if (propertiesValue !== null && propertiesValue !== undefined) { - var propertiesInstance = { accessPolicies: [] }; - vaultInstance.properties = propertiesInstance; - - var vaultUriValue = propertiesValue['vaultUri']; - if (vaultUriValue !== null && vaultUriValue !== undefined) { - var vaultUriInstance = vaultUriValue; - propertiesInstance.vaultUri = vaultUriInstance; - } - - var tenantIdValue = propertiesValue['tenantId']; - if (tenantIdValue !== null && tenantIdValue !== undefined) { - var tenantIdInstance = tenantIdValue; - propertiesInstance.tenantId = tenantIdInstance; - } - - var skuValue = propertiesValue['sku']; - if (skuValue !== null && skuValue !== undefined) { - var skuInstance = {}; - propertiesInstance.sku = skuInstance; - - var familyValue = skuValue['family']; - if (familyValue !== null && familyValue !== undefined) { - var familyInstance = familyValue; - skuInstance.family = familyInstance; - } - - var nameValue = skuValue['name']; - if (nameValue !== null && nameValue !== undefined) { - var nameInstance = nameValue; - skuInstance.name = nameInstance; - } - } - - var accessPoliciesArray = propertiesValue['accessPolicies']; - if (accessPoliciesArray !== null && accessPoliciesArray !== undefined) { - for (var loweredIndex1 = 0; loweredIndex1 < accessPoliciesArray.length; loweredIndex1 = loweredIndex1 + 1) { - var accessPoliciesValue = accessPoliciesArray[loweredIndex1]; - var accessPolicyEntryInstance = {}; - propertiesInstance.accessPolicies.push(accessPolicyEntryInstance); - - var tenantIdValue2 = accessPoliciesValue['tenantId']; - if (tenantIdValue2 !== null && tenantIdValue2 !== undefined) { - var tenantIdInstance2 = tenantIdValue2; - accessPolicyEntryInstance.tenantId = tenantIdInstance2; - } - - var objectIdValue = accessPoliciesValue['objectId']; - if (objectIdValue !== null && objectIdValue !== undefined) { - var objectIdInstance = objectIdValue; - accessPolicyEntryInstance.objectId = objectIdInstance; - } - - var permissionsValue = accessPoliciesValue['permissions']; - if (permissionsValue !== null && permissionsValue !== undefined) { - var permissionsInstance = permissionsValue; - accessPolicyEntryInstance.permissions = permissionsInstance; - } - } - } - - var enabledForDeploymentValue = propertiesValue['enabledForDeployment']; - if (enabledForDeploymentValue !== null && enabledForDeploymentValue !== undefined) { - var enabledForDeploymentInstance = enabledForDeploymentValue; - propertiesInstance.enabledForDeployment = enabledForDeploymentInstance; - } - } - - var idValue = responseDoc['id']; - if (idValue !== null && idValue !== undefined) { - var idInstance = idValue; - vaultInstance.id = idInstance; - } - - var nameValue2 = responseDoc['name']; - if (nameValue2 !== null && nameValue2 !== undefined) { - var nameInstance2 = nameValue2; - vaultInstance.name = nameInstance2; - } - - var locationValue = responseDoc['location']; - if (locationValue !== null && locationValue !== undefined) { - var locationInstance = locationValue; - vaultInstance.location = locationInstance; - } - - var tagsSequenceElement = responseDoc['tags']; - if (tagsSequenceElement !== null && tagsSequenceElement !== undefined) { - for (var property in tagsSequenceElement) { - var tagsKey = property; - var tagsValue = tagsSequenceElement[property]; - vaultInstance.tags[tagsKey] = tagsValue; - } - } - - var typeValue = responseDoc['type']; - if (typeValue !== null && typeValue !== undefined) { - var typeInstance = typeValue; - vaultInstance.type = typeInstance; - } - } - - } - result.statusCode = statusCode; - result.requestId = response.headers['x-ms-request-id']; - - return callback(null, result); - }); - }; - - /** - * Creates a new Azure key vault. - * - * @param {string} resourceGroupName The name of the Resource Group to which - * the vault belongs. - * - * @param {Number} [top] - * - * @param {function} callback - * - * @returns {Stream} The response stream. - */ - VaultOperations.prototype.list = function(resourceGroupName, top, callback) { - if (callback === null || callback === undefined) { - throw new Error('callback cannot be null.'); - } - // Validate - if (resourceGroupName === null || resourceGroupName === undefined) { - return callback(new Error('resourceGroupName cannot be null.')); - } - - // Tracing - - // Construct URL - var url2 = ''; - url2 = url2 + '/subscriptions/'; - if (this.client.credentials.subscriptionId !== null && this.client.credentials.subscriptionId !== undefined) { - url2 = url2 + encodeURIComponent(this.client.credentials.subscriptionId); - } - url2 = url2 + '/resourceGroups/'; - url2 = url2 + encodeURIComponent(resourceGroupName); - url2 = url2 + '/resources'; - var queryParameters = []; - var odataFilter = []; - odataFilter.push('resourceType eq \'Microsoft.KeyVault/vaults\' '); - if (odataFilter.length > 0) { - queryParameters.push('$filter=' + odataFilter.join(null)); - } - if (top !== null && top !== undefined) { - queryParameters.push('$top=' + encodeURIComponent(top.toString())); - } - queryParameters.push('api-version=2014-04-01'); - if (queryParameters.length > 0) { - url2 = url2 + '?' + queryParameters.join('&'); - } - var baseUrl = this.client.baseUri; - // Trim '/' character from the end of baseUrl and beginning of url. - if (baseUrl[baseUrl.length - 1] === '/') { - baseUrl = baseUrl.substring(0, (baseUrl.length - 1) + 0); - } - if (url2[0] === '/') { - url2 = url2.substring(1); - } - url2 = baseUrl + '/' + url2; - url2 = url2.replace(' ', '%20'); - - // Create HTTP transport objects - var httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.headers = {}; - httpRequest.url = url2; - - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - - // Send Request - return this.client.pipeline(httpRequest, function (err, response, body) { - if (err !== null && err !== undefined) { - return callback(err); - } - var statusCode = response.statusCode; - if (statusCode !== 200) { - var error = new Error(body); - error.statusCode = response.statusCode; - return callback(error); - } - - // Create Result - var result = null; - // Deserialize Response - if (statusCode === 200) { - var responseContent = body; - result = { vaults: [] }; - var responseDoc = null; - if (responseContent) { - responseDoc = JSON.parse(responseContent); - } - - if (responseDoc !== null && responseDoc !== undefined) { - var valueArray = responseDoc['value']; - if (valueArray !== null && valueArray !== undefined) { - for (var loweredIndex1 = 0; loweredIndex1 < valueArray.length; loweredIndex1 = loweredIndex1 + 1) { - var valueValue = valueArray[loweredIndex1]; - var vaultInstance = { tags: {} }; - result.vaults.push(vaultInstance); - - var propertiesValue = valueValue['properties']; - if (propertiesValue !== null && propertiesValue !== undefined) { - var propertiesInstance = { accessPolicies: [] }; - vaultInstance.properties = propertiesInstance; - - var vaultUriValue = propertiesValue['vaultUri']; - if (vaultUriValue !== null && vaultUriValue !== undefined) { - var vaultUriInstance = vaultUriValue; - propertiesInstance.vaultUri = vaultUriInstance; - } - - var tenantIdValue = propertiesValue['tenantId']; - if (tenantIdValue !== null && tenantIdValue !== undefined) { - var tenantIdInstance = tenantIdValue; - propertiesInstance.tenantId = tenantIdInstance; - } - - var skuValue = propertiesValue['sku']; - if (skuValue !== null && skuValue !== undefined) { - var skuInstance = {}; - propertiesInstance.sku = skuInstance; - - var familyValue = skuValue['family']; - if (familyValue !== null && familyValue !== undefined) { - var familyInstance = familyValue; - skuInstance.family = familyInstance; - } - - var nameValue = skuValue['name']; - if (nameValue !== null && nameValue !== undefined) { - var nameInstance = nameValue; - skuInstance.name = nameInstance; - } - } - - var accessPoliciesArray = propertiesValue['accessPolicies']; - if (accessPoliciesArray !== null && accessPoliciesArray !== undefined) { - for (var loweredIndex2 = 0; loweredIndex2 < accessPoliciesArray.length; loweredIndex2 = loweredIndex2 + 1) { - var accessPoliciesValue = accessPoliciesArray[loweredIndex2]; - var accessPolicyEntryInstance = {}; - propertiesInstance.accessPolicies.push(accessPolicyEntryInstance); - - var tenantIdValue2 = accessPoliciesValue['tenantId']; - if (tenantIdValue2 !== null && tenantIdValue2 !== undefined) { - var tenantIdInstance2 = tenantIdValue2; - accessPolicyEntryInstance.tenantId = tenantIdInstance2; - } - - var objectIdValue = accessPoliciesValue['objectId']; - if (objectIdValue !== null && objectIdValue !== undefined) { - var objectIdInstance = objectIdValue; - accessPolicyEntryInstance.objectId = objectIdInstance; - } - - var permissionsValue = accessPoliciesValue['permissions']; - if (permissionsValue !== null && permissionsValue !== undefined) { - var permissionsInstance = permissionsValue; - accessPolicyEntryInstance.permissions = permissionsInstance; - } - } - } - - var enabledForDeploymentValue = propertiesValue['enabledForDeployment']; - if (enabledForDeploymentValue !== null && enabledForDeploymentValue !== undefined) { - var enabledForDeploymentInstance = enabledForDeploymentValue; - propertiesInstance.enabledForDeployment = enabledForDeploymentInstance; - } - } - - var idValue = valueValue['id']; - if (idValue !== null && idValue !== undefined) { - var idInstance = idValue; - vaultInstance.id = idInstance; - } - - var nameValue2 = valueValue['name']; - if (nameValue2 !== null && nameValue2 !== undefined) { - var nameInstance2 = nameValue2; - vaultInstance.name = nameInstance2; - } - - var locationValue = valueValue['location']; - if (locationValue !== null && locationValue !== undefined) { - var locationInstance = locationValue; - vaultInstance.location = locationInstance; - } - - var tagsSequenceElement = valueValue['tags']; - if (tagsSequenceElement !== null && tagsSequenceElement !== undefined) { - for (var property in tagsSequenceElement) { - var tagsKey = property; - var tagsValue = tagsSequenceElement[property]; - vaultInstance.tags[tagsKey] = tagsValue; - } - } - - var typeValue = valueValue['type']; - if (typeValue !== null && typeValue !== undefined) { - var typeInstance = typeValue; - vaultInstance.type = typeInstance; - } - } - } - - var nextLinkValue = responseDoc['nextLink']; - if (nextLinkValue !== null && nextLinkValue !== undefined) { - var nextLinkInstance = nextLinkValue; - result.nextLink = nextLinkInstance; - } - } - - } - result.statusCode = statusCode; - result.requestId = response.headers['x-ms-request-id']; - - return callback(null, result); - }); - }; - - /** - * Creates a new Azure key vault. - * - * @param {string} nextLink Next link. - * - * @param {function} callback - * - * @returns {Stream} The response stream. - */ - VaultOperations.prototype.listNext = function(nextLink, callback) { - if (callback === null || callback === undefined) { - throw new Error('callback cannot be null.'); - } - // Validate - if (nextLink === null || nextLink === undefined) { - return callback(new Error('nextLink cannot be null.')); - } - - // Tracing - - // Construct URL - var url2 = ''; - url2 = url2 + nextLink; - url2 = url2.replace(' ', '%20'); - - // Create HTTP transport objects - var httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.headers = {}; - httpRequest.url = url2; - - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - - // Send Request - return this.client.pipeline(httpRequest, function (err, response, body) { - if (err !== null && err !== undefined) { - return callback(err); - } - var statusCode = response.statusCode; - if (statusCode !== 200) { - var error = new Error(body); - error.statusCode = response.statusCode; - return callback(error); - } - - // Create Result - var result = null; - // Deserialize Response - if (statusCode === 200) { - var responseContent = body; - result = { vaults: [] }; - var responseDoc = null; - if (responseContent) { - responseDoc = JSON.parse(responseContent); - } - - if (responseDoc !== null && responseDoc !== undefined) { - var valueArray = responseDoc['value']; - if (valueArray !== null && valueArray !== undefined) { - for (var loweredIndex1 = 0; loweredIndex1 < valueArray.length; loweredIndex1 = loweredIndex1 + 1) { - var valueValue = valueArray[loweredIndex1]; - var vaultInstance = { tags: {} }; - result.vaults.push(vaultInstance); - - var propertiesValue = valueValue['properties']; - if (propertiesValue !== null && propertiesValue !== undefined) { - var propertiesInstance = { accessPolicies: [] }; - vaultInstance.properties = propertiesInstance; - - var vaultUriValue = propertiesValue['vaultUri']; - if (vaultUriValue !== null && vaultUriValue !== undefined) { - var vaultUriInstance = vaultUriValue; - propertiesInstance.vaultUri = vaultUriInstance; - } - - var tenantIdValue = propertiesValue['tenantId']; - if (tenantIdValue !== null && tenantIdValue !== undefined) { - var tenantIdInstance = tenantIdValue; - propertiesInstance.tenantId = tenantIdInstance; - } - - var skuValue = propertiesValue['sku']; - if (skuValue !== null && skuValue !== undefined) { - var skuInstance = {}; - propertiesInstance.sku = skuInstance; - - var familyValue = skuValue['family']; - if (familyValue !== null && familyValue !== undefined) { - var familyInstance = familyValue; - skuInstance.family = familyInstance; - } - - var nameValue = skuValue['name']; - if (nameValue !== null && nameValue !== undefined) { - var nameInstance = nameValue; - skuInstance.name = nameInstance; - } - } - - var accessPoliciesArray = propertiesValue['accessPolicies']; - if (accessPoliciesArray !== null && accessPoliciesArray !== undefined) { - for (var loweredIndex2 = 0; loweredIndex2 < accessPoliciesArray.length; loweredIndex2 = loweredIndex2 + 1) { - var accessPoliciesValue = accessPoliciesArray[loweredIndex2]; - var accessPolicyEntryInstance = {}; - propertiesInstance.accessPolicies.push(accessPolicyEntryInstance); - - var tenantIdValue2 = accessPoliciesValue['tenantId']; - if (tenantIdValue2 !== null && tenantIdValue2 !== undefined) { - var tenantIdInstance2 = tenantIdValue2; - accessPolicyEntryInstance.tenantId = tenantIdInstance2; - } - - var objectIdValue = accessPoliciesValue['objectId']; - if (objectIdValue !== null && objectIdValue !== undefined) { - var objectIdInstance = objectIdValue; - accessPolicyEntryInstance.objectId = objectIdInstance; - } - - var permissionsValue = accessPoliciesValue['permissions']; - if (permissionsValue !== null && permissionsValue !== undefined) { - var permissionsInstance = permissionsValue; - accessPolicyEntryInstance.permissions = permissionsInstance; - } - } - } - - var enabledForDeploymentValue = propertiesValue['enabledForDeployment']; - if (enabledForDeploymentValue !== null && enabledForDeploymentValue !== undefined) { - var enabledForDeploymentInstance = enabledForDeploymentValue; - propertiesInstance.enabledForDeployment = enabledForDeploymentInstance; - } - } - - var idValue = valueValue['id']; - if (idValue !== null && idValue !== undefined) { - var idInstance = idValue; - vaultInstance.id = idInstance; - } - - var nameValue2 = valueValue['name']; - if (nameValue2 !== null && nameValue2 !== undefined) { - var nameInstance2 = nameValue2; - vaultInstance.name = nameInstance2; - } - - var locationValue = valueValue['location']; - if (locationValue !== null && locationValue !== undefined) { - var locationInstance = locationValue; - vaultInstance.location = locationInstance; - } - - var tagsSequenceElement = valueValue['tags']; - if (tagsSequenceElement !== null && tagsSequenceElement !== undefined) { - for (var property in tagsSequenceElement) { - var tagsKey = property; - var tagsValue = tagsSequenceElement[property]; - vaultInstance.tags[tagsKey] = tagsValue; - } - } - - var typeValue = valueValue['type']; - if (typeValue !== null && typeValue !== undefined) { - var typeInstance = typeValue; - vaultInstance.type = typeInstance; - } - } - } - - var nextLinkValue = responseDoc['nextLink']; - if (nextLinkValue !== null && nextLinkValue !== undefined) { - var nextLinkInstance = nextLinkValue; - result.nextLink = nextLinkInstance; - } - } - - } - result.statusCode = statusCode; - result.requestId = response.headers['x-ms-request-id']; - - return callback(null, result); - }); - }; - - return VaultOperations; -})(); + if (subscriptionId === null || subscriptionId === undefined) { + throw new Error('\'subscriptionId\' cannot be null.'); + } + + if (!options) options = {}; + + KeyVaultManagementClient['super_'].call(this, credentials, options); + this.baseUri = baseUri; + if (!this.baseUri) { + this.baseUri = 'https://management.azure.com'; + } + this.credentials = credentials; + this.subscriptionId = subscriptionId; + + if(options.apiVersion !== null && options.apiVersion !== undefined) { + this.apiVersion = options.apiVersion; + } + if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + this.acceptLanguage = options.acceptLanguage; + } + if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; + } + if(options.generateClientRequestId !== null && options.generateClientRequestId !== undefined) { + this.generateClientRequestId = options.generateClientRequestId; + } + this.vaults = new operations.Vaults(this); + this.models = models; + msRest.addSerializationMixin(this); +} + +util.inherits(KeyVaultManagementClient, ServiceClient); + +module.exports = KeyVaultManagementClient; diff --git a/lib/services/keyVaultManagement/lib/models/accessPolicyEntry.js b/lib/services/keyVaultManagement/lib/models/accessPolicyEntry.js new file mode 100644 index 000000000..2bd06e5fb --- /dev/null +++ b/lib/services/keyVaultManagement/lib/models/accessPolicyEntry.js @@ -0,0 +1,94 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var models = require('./index'); + +/** + * @class + * Initializes a new instance of the AccessPolicyEntry class. + * @constructor + * An array of 0 to 16 identities that have access to the key vault. All + * identities in the array must use the same tenant ID as the key vault's + * tenant ID. + * + * @member {uuid} tenantId The Azure Active Directory tenant ID that should be + * used for authenticating requests to the key vault. + * + * @member {uuid} objectId The object ID of a user or service principal in the + * Azure Active Directory tenant for the vault. The object ID must be unique + * for the list of access policies. + * + * @member {uuid} [applicationId] Application ID of the client making request + * on behalf of a principal + * + * @member {object} permissions Permissions the identity has for keys, secrets + * and certificates. + * + * @member {array} [permissions.keys] Permissions to keys + * + * @member {array} [permissions.secrets] Permissions to secrets + * + * @member {array} [permissions.certificates] Permissions to certificates + * + */ +function AccessPolicyEntry() { +} + +/** + * Defines the metadata of AccessPolicyEntry + * + * @returns {object} metadata of AccessPolicyEntry + * + */ +AccessPolicyEntry.prototype.mapper = function () { + return { + required: false, + serializedName: 'AccessPolicyEntry', + type: { + name: 'Composite', + className: 'AccessPolicyEntry', + modelProperties: { + tenantId: { + required: true, + serializedName: 'tenantId', + type: { + name: 'String' + } + }, + objectId: { + required: true, + serializedName: 'objectId', + type: { + name: 'String' + } + }, + applicationId: { + required: false, + serializedName: 'applicationId', + type: { + name: 'String' + } + }, + permissions: { + required: true, + serializedName: 'permissions', + type: { + name: 'Composite', + className: 'Permissions' + } + } + } + } + }; +}; + +module.exports = AccessPolicyEntry; diff --git a/lib/services/keyVaultManagement/lib/models/index.d.ts b/lib/services/keyVaultManagement/lib/models/index.d.ts new file mode 100644 index 000000000..fabd3567b --- /dev/null +++ b/lib/services/keyVaultManagement/lib/models/index.d.ts @@ -0,0 +1,241 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. +// TODO: Include PageTemplateModels here too?? Probably + */ + + +/** + * @class + * Initializes a new instance of the Sku class. + * @constructor + * SKU details + * + * @member {string} name SKU name to specify whether the key vault is a + * standard vault or a premium vault. Possible values include: 'standard', + * 'premium' + * + */ +export interface Sku { + name: string; +} + +/** + * @class + * Initializes a new instance of the AccessPolicyEntry class. + * @constructor + * An array of 0 to 16 identities that have access to the key vault. All + * identities in the array must use the same tenant ID as the key vault's + * tenant ID. + * + * @member {uuid} tenantId The Azure Active Directory tenant ID that should be + * used for authenticating requests to the key vault. + * + * @member {uuid} objectId The object ID of a user or service principal in the + * Azure Active Directory tenant for the vault. The object ID must be unique + * for the list of access policies. + * + * @member {uuid} [applicationId] Application ID of the client making request + * on behalf of a principal + * + * @member {object} permissions Permissions the identity has for keys, secrets + * and certificates. + * + * @member {array} [permissions.keys] Permissions to keys + * + * @member {array} [permissions.secrets] Permissions to secrets + * + * @member {array} [permissions.certificates] Permissions to certificates + * + */ +export interface AccessPolicyEntry { + tenantId: string; + objectId: string; + applicationId?: string; + permissions: Permissions; +} + +/** + * @class + * Initializes a new instance of the Permissions class. + * @constructor + * Permissions the identity has for keys, secrets and certificates. + * + * @member {array} [keys] Permissions to keys + * + * @member {array} [secrets] Permissions to secrets + * + * @member {array} [certificates] Permissions to certificates + * + */ +export interface Permissions { + keys?: string[]; + secrets?: string[]; + certificates?: string[]; +} + +/** + * @class + * Initializes a new instance of the VaultProperties class. + * @constructor + * Properties of the vault + * + * @member {string} [vaultUri] The URI of the vault for performing operations + * on keys and secrets. + * + * @member {uuid} tenantId The Azure Active Directory tenant ID that should be + * used for authenticating requests to the key vault. + * + * @member {object} sku SKU details + * + * @member {string} [sku.name] SKU name to specify whether the key vault is a + * standard vault or a premium vault. Possible values include: 'standard', + * 'premium' + * + * @member {array} accessPolicies An array of 0 to 16 identities that have + * access to the key vault. All identities in the array must use the same + * tenant ID as the key vault's tenant ID. + * + * @member {boolean} [enabledForDeployment] Property to specify whether Azure + * Virtual Machines are permitted to retrieve certificates stored as secrets + * from the key vault. + * + * @member {boolean} [enabledForDiskEncryption] Property to specify whether + * Azure Disk Encryption is permitted to retrieve secrets from the vault and + * unwrap keys. + * + * @member {boolean} [enabledForTemplateDeployment] Property to specify + * whether Azure Resource Manager is permitted to retrieve secrets from the + * key vault. + * + */ +export interface VaultProperties { + vaultUri?: string; + tenantId: string; + sku: Sku; + accessPolicies: AccessPolicyEntry[]; + enabledForDeployment?: boolean; + enabledForDiskEncryption?: boolean; + enabledForTemplateDeployment?: boolean; +} + +/** + * @class + * Initializes a new instance of the VaultCreateOrUpdateParameters class. + * @constructor + * Parameters for creating or updating a vault + * + * @member {string} location The supported Azure location where the key vault + * should be created. + * + * @member {object} [tags] The tags that will be assigned to the key vault. + * + * @member {object} properties Properties of the vault + * + * @member {string} [properties.vaultUri] The URI of the vault for performing + * operations on keys and secrets. + * + * @member {uuid} [properties.tenantId] The Azure Active Directory tenant ID + * that should be used for authenticating requests to the key vault. + * + * @member {object} [properties.sku] SKU details + * + * @member {string} [properties.sku.name] SKU name to specify whether the key + * vault is a standard vault or a premium vault. Possible values include: + * 'standard', 'premium' + * + * @member {array} [properties.accessPolicies] An array of 0 to 16 identities + * that have access to the key vault. All identities in the array must use + * the same tenant ID as the key vault's tenant ID. + * + * @member {boolean} [properties.enabledForDeployment] Property to specify + * whether Azure Virtual Machines are permitted to retrieve certificates + * stored as secrets from the key vault. + * + * @member {boolean} [properties.enabledForDiskEncryption] Property to specify + * whether Azure Disk Encryption is permitted to retrieve secrets from the + * vault and unwrap keys. + * + * @member {boolean} [properties.enabledForTemplateDeployment] Property to + * specify whether Azure Resource Manager is permitted to retrieve secrets + * from the key vault. + * + */ +export interface VaultCreateOrUpdateParameters extends BaseResource { + location: string; + tags?: { [propertyName: string]: string }; + properties: VaultProperties; +} + +/** + * @class + * Initializes a new instance of the Resource class. + * @constructor + * Key Vault resource + * + * @member {string} [id] The Azure Resource Manager resource ID for the key + * vault. + * + * @member {string} name The name of the key vault. + * + * @member {string} [type] The resource type of the key vault. + * + * @member {string} location The supported Azure location where the key vault + * should be created. + * + * @member {object} [tags] The tags that will be assigned to the key vault. + * + */ +export interface Resource extends BaseResource { + id?: string; + name: string; + type?: string; + location: string; + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the Vault class. + * @constructor + * Resource information with extended details. + * + * @member {object} properties Properties of the vault + * + * @member {string} [properties.vaultUri] The URI of the vault for performing + * operations on keys and secrets. + * + * @member {uuid} [properties.tenantId] The Azure Active Directory tenant ID + * that should be used for authenticating requests to the key vault. + * + * @member {object} [properties.sku] SKU details + * + * @member {string} [properties.sku.name] SKU name to specify whether the key + * vault is a standard vault or a premium vault. Possible values include: + * 'standard', 'premium' + * + * @member {array} [properties.accessPolicies] An array of 0 to 16 identities + * that have access to the key vault. All identities in the array must use + * the same tenant ID as the key vault's tenant ID. + * + * @member {boolean} [properties.enabledForDeployment] Property to specify + * whether Azure Virtual Machines are permitted to retrieve certificates + * stored as secrets from the key vault. + * + * @member {boolean} [properties.enabledForDiskEncryption] Property to specify + * whether Azure Disk Encryption is permitted to retrieve secrets from the + * vault and unwrap keys. + * + * @member {boolean} [properties.enabledForTemplateDeployment] Property to + * specify whether Azure Resource Manager is permitted to retrieve secrets + * from the key vault. + * + */ +export interface Vault extends Resource { + properties: VaultProperties; +} diff --git a/lib/services/keyVaultManagement/lib/models/index.js b/lib/services/keyVaultManagement/lib/models/index.js new file mode 100644 index 000000000..e1df1a48d --- /dev/null +++ b/lib/services/keyVaultManagement/lib/models/index.js @@ -0,0 +1,28 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +/* jshint latedef:false */ +/* jshint forin:false */ +/* jshint noempty:false */ + +'use strict'; + +var msRestAzure = require('ms-rest-azure'); + +exports.BaseResource = msRestAzure.BaseResource; +exports.CloudError = msRestAzure.CloudError; +exports.Sku = require('./sku'); +exports.AccessPolicyEntry = require('./accessPolicyEntry'); +exports.Permissions = require('./permissions'); +exports.VaultProperties = require('./vaultProperties'); +exports.VaultCreateOrUpdateParameters = require('./vaultCreateOrUpdateParameters'); +exports.Resource = require('./resource'); +exports.Vault = require('./vault'); +exports.VaultListResult = require('./vaultListResult'); diff --git a/lib/services/keyVaultManagement/lib/models/permissions.js b/lib/services/keyVaultManagement/lib/models/permissions.js new file mode 100644 index 000000000..1afc559ba --- /dev/null +++ b/lib/services/keyVaultManagement/lib/models/permissions.js @@ -0,0 +1,92 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var util = require('util'); + +/** + * @class + * Initializes a new instance of the Permissions class. + * @constructor + * Permissions the identity has for keys, secrets and certificates. + * + * @member {array} [keys] Permissions to keys + * + * @member {array} [secrets] Permissions to secrets + * + * @member {array} [certificates] Permissions to certificates + * + */ +function Permissions() { +} + +/** + * Defines the metadata of Permissions + * + * @returns {object} metadata of Permissions + * + */ +Permissions.prototype.mapper = function () { + return { + required: false, + serializedName: 'Permissions', + type: { + name: 'Composite', + className: 'Permissions', + modelProperties: { + keys: { + required: false, + serializedName: 'keys', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + secrets: { + required: false, + serializedName: 'secrets', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + certificates: { + required: false, + serializedName: 'certificates', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; +}; + +module.exports = Permissions; diff --git a/lib/services/keyVaultManagement/lib/models/resource.js b/lib/services/keyVaultManagement/lib/models/resource.js new file mode 100644 index 000000000..52d5493f6 --- /dev/null +++ b/lib/services/keyVaultManagement/lib/models/resource.js @@ -0,0 +1,105 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var models = require('./index'); + +var util = require('util'); + +/** + * @class + * Initializes a new instance of the Resource class. + * @constructor + * Key Vault resource + * + * @member {string} [id] The Azure Resource Manager resource ID for the key + * vault. + * + * @member {string} name The name of the key vault. + * + * @member {string} [type] The resource type of the key vault. + * + * @member {string} location The supported Azure location where the key vault + * should be created. + * + * @member {object} [tags] The tags that will be assigned to the key vault. + * + */ +function Resource() { + Resource['super_'].call(this); +} + +util.inherits(Resource, models['BaseResource']); + +/** + * Defines the metadata of Resource + * + * @returns {object} metadata of Resource + * + */ +Resource.prototype.mapper = function () { + return { + required: false, + serializedName: 'Resource', + type: { + name: 'Composite', + className: 'Resource', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; +}; + +module.exports = Resource; diff --git a/lib/services/keyVaultManagement/lib/models/sku.js b/lib/services/keyVaultManagement/lib/models/sku.js new file mode 100644 index 000000000..16301d96c --- /dev/null +++ b/lib/services/keyVaultManagement/lib/models/sku.js @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * @class + * Initializes a new instance of the Sku class. + * @constructor + * SKU details + * + * @member {string} name SKU name to specify whether the key vault is a + * standard vault or a premium vault. Possible values include: 'standard', + * 'premium' + * + */ +function Sku() { +} + +/** + * Defines the metadata of Sku + * + * @returns {object} metadata of Sku + * + */ +Sku.prototype.mapper = function () { + return { + required: false, + serializedName: 'Sku', + type: { + name: 'Composite', + className: 'Sku', + modelProperties: { + family: { + required: true, + isConstant: true, + serializedName: 'family', + defaultValue: 'A', + type: { + name: 'String' + } + }, + name: { + required: true, + serializedName: 'name', + type: { + name: 'Enum', + allowedValues: [ 'standard', 'premium' ] + } + } + } + } + }; +}; + +module.exports = Sku; diff --git a/lib/services/keyVaultManagement/lib/models/subResource.js b/lib/services/keyVaultManagement/lib/models/subResource.js new file mode 100644 index 000000000..a43b456fc --- /dev/null +++ b/lib/services/keyVaultManagement/lib/models/subResource.js @@ -0,0 +1,52 @@ +/* + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var models = require('./index'); + +var util = require('util'); + +/** + * @class + * Initializes a new instance of the SubResource class. + * @constructor + * @member {string} [id] Resource Id + * + */ +function SubResource() { + SubResource['super_'].call(this); +} + +util.inherits(SubResource, models['BaseResource']); + +/** + * Defines the metadata of SubResource + * + * @returns {object} metadata of SubResource + * + */ +SubResource.prototype.mapper = function () { + return { + required: false, + serializedName: 'SubResource', + type: { + name: 'Composite', + className: 'SubResource', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + } + } + } + }; +}; + +module.exports = SubResource; diff --git a/lib/services/keyVaultManagement/lib/models/vault.js b/lib/services/keyVaultManagement/lib/models/vault.js new file mode 100644 index 000000000..dab05e0bc --- /dev/null +++ b/lib/services/keyVaultManagement/lib/models/vault.js @@ -0,0 +1,132 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var models = require('./index'); + +var util = require('util'); + +/** + * @class + * Initializes a new instance of the Vault class. + * @constructor + * Resource information with extended details. + * + * @member {object} properties Properties of the vault + * + * @member {string} [properties.vaultUri] The URI of the vault for performing + * operations on keys and secrets. + * + * @member {uuid} [properties.tenantId] The Azure Active Directory tenant ID + * that should be used for authenticating requests to the key vault. + * + * @member {object} [properties.sku] SKU details + * + * @member {string} [properties.sku.name] SKU name to specify whether the key + * vault is a standard vault or a premium vault. Possible values include: + * 'standard', 'premium' + * + * @member {array} [properties.accessPolicies] An array of 0 to 16 identities + * that have access to the key vault. All identities in the array must use + * the same tenant ID as the key vault's tenant ID. + * + * @member {boolean} [properties.enabledForDeployment] Property to specify + * whether Azure Virtual Machines are permitted to retrieve certificates + * stored as secrets from the key vault. + * + * @member {boolean} [properties.enabledForDiskEncryption] Property to specify + * whether Azure Disk Encryption is permitted to retrieve secrets from the + * vault and unwrap keys. + * + * @member {boolean} [properties.enabledForTemplateDeployment] Property to + * specify whether Azure Resource Manager is permitted to retrieve secrets + * from the key vault. + * + */ +function Vault() { + Vault['super_'].call(this); +} + +util.inherits(Vault, models['Resource']); + +/** + * Defines the metadata of Vault + * + * @returns {object} metadata of Vault + * + */ +Vault.prototype.mapper = function () { + return { + required: false, + serializedName: 'Vault', + type: { + name: 'Composite', + className: 'Vault', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + properties: { + required: true, + serializedName: 'properties', + defaultValue: {}, + type: { + name: 'Composite', + className: 'VaultProperties' + } + } + } + } + }; +}; + +module.exports = Vault; diff --git a/lib/services/keyVaultManagement/lib/models/vaultCreateOrUpdateParameters.js b/lib/services/keyVaultManagement/lib/models/vaultCreateOrUpdateParameters.js new file mode 100644 index 000000000..255963640 --- /dev/null +++ b/lib/services/keyVaultManagement/lib/models/vaultCreateOrUpdateParameters.js @@ -0,0 +1,114 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var models = require('./index'); + +var util = require('util'); + +/** + * @class + * Initializes a new instance of the VaultCreateOrUpdateParameters class. + * @constructor + * Parameters for creating or updating a vault + * + * @member {string} location The supported Azure location where the key vault + * should be created. + * + * @member {object} [tags] The tags that will be assigned to the key vault. + * + * @member {object} properties Properties of the vault + * + * @member {string} [properties.vaultUri] The URI of the vault for performing + * operations on keys and secrets. + * + * @member {uuid} [properties.tenantId] The Azure Active Directory tenant ID + * that should be used for authenticating requests to the key vault. + * + * @member {object} [properties.sku] SKU details + * + * @member {string} [properties.sku.name] SKU name to specify whether the key + * vault is a standard vault or a premium vault. Possible values include: + * 'standard', 'premium' + * + * @member {array} [properties.accessPolicies] An array of 0 to 16 identities + * that have access to the key vault. All identities in the array must use + * the same tenant ID as the key vault's tenant ID. + * + * @member {boolean} [properties.enabledForDeployment] Property to specify + * whether Azure Virtual Machines are permitted to retrieve certificates + * stored as secrets from the key vault. + * + * @member {boolean} [properties.enabledForDiskEncryption] Property to specify + * whether Azure Disk Encryption is permitted to retrieve secrets from the + * vault and unwrap keys. + * + * @member {boolean} [properties.enabledForTemplateDeployment] Property to + * specify whether Azure Resource Manager is permitted to retrieve secrets + * from the key vault. + * + */ +function VaultCreateOrUpdateParameters() { + VaultCreateOrUpdateParameters['super_'].call(this); +} + +util.inherits(VaultCreateOrUpdateParameters, models['BaseResource']); + +/** + * Defines the metadata of VaultCreateOrUpdateParameters + * + * @returns {object} metadata of VaultCreateOrUpdateParameters + * + */ +VaultCreateOrUpdateParameters.prototype.mapper = function () { + return { + required: false, + serializedName: 'VaultCreateOrUpdateParameters', + type: { + name: 'Composite', + className: 'VaultCreateOrUpdateParameters', + modelProperties: { + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + properties: { + required: true, + serializedName: 'properties', + defaultValue: {}, + type: { + name: 'Composite', + className: 'VaultProperties' + } + } + } + } + }; +}; + +module.exports = VaultCreateOrUpdateParameters; diff --git a/lib/services/keyVaultManagement/lib/models/vaultListResult.js b/lib/services/keyVaultManagement/lib/models/vaultListResult.js new file mode 100644 index 000000000..c9f421425 --- /dev/null +++ b/lib/services/keyVaultManagement/lib/models/vaultListResult.js @@ -0,0 +1,72 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var util = require('util'); + +/** + * @class + * Initializes a new instance of the VaultListResult class. + * @constructor + * List of vaults + * @member {array} [value] Gets or sets the list of vaults. + * + * @member {string} [nextLink] Gets or sets the URL to get the next set of + * vaults. + * + */ +function VaultListResult() { +} + +util.inherits(VaultListResult, Array); + +/** + * Defines the metadata of VaultListResult + * + * @returns {object} metadata of VaultListResult + * + */ +VaultListResult.prototype.mapper = function () { + return { + required: false, + serializedName: 'VaultListResult', + type: { + name: 'Composite', + className: 'VaultListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VaultElementType', + type: { + name: 'Composite', + className: 'Vault' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; +}; + +module.exports = VaultListResult; diff --git a/lib/services/keyVaultManagement/lib/models/vaultProperties.js b/lib/services/keyVaultManagement/lib/models/vaultProperties.js new file mode 100644 index 000000000..1a6eb2bfe --- /dev/null +++ b/lib/services/keyVaultManagement/lib/models/vaultProperties.js @@ -0,0 +1,136 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var models = require('./index'); + +var util = require('util'); + +/** + * @class + * Initializes a new instance of the VaultProperties class. + * @constructor + * Properties of the vault + * + * @member {string} [vaultUri] The URI of the vault for performing operations + * on keys and secrets. + * + * @member {uuid} tenantId The Azure Active Directory tenant ID that should be + * used for authenticating requests to the key vault. + * + * @member {object} sku SKU details + * + * @member {string} [sku.name] SKU name to specify whether the key vault is a + * standard vault or a premium vault. Possible values include: 'standard', + * 'premium' + * + * @member {array} accessPolicies An array of 0 to 16 identities that have + * access to the key vault. All identities in the array must use the same + * tenant ID as the key vault's tenant ID. + * + * @member {boolean} [enabledForDeployment] Property to specify whether Azure + * Virtual Machines are permitted to retrieve certificates stored as secrets + * from the key vault. + * + * @member {boolean} [enabledForDiskEncryption] Property to specify whether + * Azure Disk Encryption is permitted to retrieve secrets from the vault and + * unwrap keys. + * + * @member {boolean} [enabledForTemplateDeployment] Property to specify + * whether Azure Resource Manager is permitted to retrieve secrets from the + * key vault. + * + */ +function VaultProperties() { +} + +/** + * Defines the metadata of VaultProperties + * + * @returns {object} metadata of VaultProperties + * + */ +VaultProperties.prototype.mapper = function () { + return { + required: false, + serializedName: 'VaultProperties', + type: { + name: 'Composite', + className: 'VaultProperties', + modelProperties: { + vaultUri: { + required: false, + serializedName: 'vaultUri', + type: { + name: 'String' + } + }, + tenantId: { + required: true, + serializedName: 'tenantId', + type: { + name: 'String' + } + }, + sku: { + required: true, + serializedName: 'sku', + defaultValue: {}, + type: { + name: 'Composite', + className: 'Sku' + } + }, + accessPolicies: { + required: true, + serializedName: 'accessPolicies', + constraints: { + MaxItems: 16 + }, + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AccessPolicyEntryElementType', + type: { + name: 'Composite', + className: 'AccessPolicyEntry' + } + } + } + }, + enabledForDeployment: { + required: false, + serializedName: 'enabledForDeployment', + type: { + name: 'Boolean' + } + }, + enabledForDiskEncryption: { + required: false, + serializedName: 'enabledForDiskEncryption', + type: { + name: 'Boolean' + } + }, + enabledForTemplateDeployment: { + required: false, + serializedName: 'enabledForTemplateDeployment', + type: { + name: 'Boolean' + } + } + } + } + }; +}; + +module.exports = VaultProperties; diff --git a/lib/services/keyVaultManagement/lib/operations/index.d.ts b/lib/services/keyVaultManagement/lib/operations/index.d.ts new file mode 100644 index 000000000..02190c579 --- /dev/null +++ b/lib/services/keyVaultManagement/lib/operations/index.d.ts @@ -0,0 +1,190 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. +*/ + +import { ServiceClientOptions, RequestOptions, ServiceCallback } from 'ms-rest'; +import * as models from '../models'; + + +/** + * @class + * Vaults + * __NOTE__: An instance of this class is automatically created for an + * instance of the KeyVaultManagementClient. + */ +export interface Vaults { + + /** + * Create or update a key vault in the specified subscription. + * + * @param {string} resourceGroupName The name of the Resource Group to which + * the server belongs. + * + * @param {string} vaultName Name of the vault + * + * @param {object} parameters Parameters to create or update the vault + * + * @param {string} parameters.location The supported Azure location where the + * key vault should be created. + * + * @param {object} [parameters.tags] The tags that will be assigned to the key + * vault. + * + * @param {object} parameters.properties Properties of the vault + * + * @param {string} [parameters.properties.vaultUri] The URI of the vault for + * performing operations on keys and secrets. + * + * @param {uuid} parameters.properties.tenantId The Azure Active Directory + * tenant ID that should be used for authenticating requests to the key vault. + * + * @param {object} parameters.properties.sku SKU details + * + * @param {string} parameters.properties.sku.name SKU name to specify whether + * the key vault is a standard vault or a premium vault. Possible values + * include: 'standard', 'premium' + * + * @param {array} parameters.properties.accessPolicies An array of 0 to 16 + * identities that have access to the key vault. All identities in the array + * must use the same tenant ID as the key vault's tenant ID. + * + * @param {boolean} [parameters.properties.enabledForDeployment] Property to + * specify whether Azure Virtual Machines are permitted to retrieve + * certificates stored as secrets from the key vault. + * + * @param {boolean} [parameters.properties.enabledForDiskEncryption] Property + * to specify whether Azure Disk Encryption is permitted to retrieve secrets + * from the vault and unwrap keys. + * + * @param {boolean} [parameters.properties.enabledForTemplateDeployment] + * Property to specify whether Azure Resource Manager is permitted to + * retrieve secrets from the key vault. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + createOrUpdate(resourceGroupName: string, vaultName: string, parameters: models.VaultCreateOrUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, vaultName: string, parameters: models.VaultCreateOrUpdateParameters, callback: ServiceCallback): void; + + /** + * Deletes the specified Azure key vault. + * + * @param {string} resourceGroupName The name of the Resource Group to which + * the vault belongs. + * + * @param {string} vaultName The name of the vault to delete + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + deleteMethod(resourceGroupName: string, vaultName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, vaultName: string, callback: ServiceCallback): void; + + /** + * Gets the specified Azure key vault. + * + * @param {string} resourceGroupName The name of the Resource Group to which + * the vault belongs. + * + * @param {string} vaultName The name of the vault. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + get(resourceGroupName: string, vaultName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, vaultName: string, callback: ServiceCallback): void; + + /** + * The List operation gets information about the vaults associated with the + * subscription and within the specified resource group. + * + * @param {string} resourceGroupName The name of the Resource Group to which + * the vault belongs. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.top] Maximum number of results to return. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + listByResourceGroup(resourceGroupName: string, options: { top? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; + + /** + * The List operation gets information about the vaults associated with the + * subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.top] Maximum number of results to return. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + list(options: { top? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(callback: ServiceCallback): void; + + /** + * The List operation gets information about the vaults associated with the + * subscription and within the specified resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; + + /** + * The List operation gets information about the vaults associated with the + * subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [callback] callback function; see ServiceCallback + * doc in ms-rest index.d.ts for details + */ + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listNext(nextPageLink: string, callback: ServiceCallback): void; +} diff --git a/lib/services/keyVaultManagement/lib/operations/index.js b/lib/services/keyVaultManagement/lib/operations/index.js new file mode 100644 index 000000000..471dc3746 --- /dev/null +++ b/lib/services/keyVaultManagement/lib/operations/index.js @@ -0,0 +1,17 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +/* jshint latedef:false */ +/* jshint forin:false */ +/* jshint noempty:false */ + +'use strict'; + +exports.Vaults = require('./vaults'); diff --git a/lib/services/keyVaultManagement/lib/operations/vaults.js b/lib/services/keyVaultManagement/lib/operations/vaults.js new file mode 100644 index 000000000..28ecc7c87 --- /dev/null +++ b/lib/services/keyVaultManagement/lib/operations/vaults.js @@ -0,0 +1,1094 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +var util = require('util'); +var msRest = require('ms-rest'); +var msRestAzure = require('ms-rest-azure'); +var WebResource = msRest.WebResource; + +/** + * @class + * Vaults + * __NOTE__: An instance of this class is automatically created for an + * instance of the KeyVaultManagementClient. + * Initializes a new instance of the Vaults class. + * @constructor + * + * @param {KeyVaultManagementClient} client Reference to the service client. + */ +function Vaults(client) { + this.client = client; +} + +/** + * Create or update a key vault in the specified subscription. + * + * @param {string} resourceGroupName The name of the Resource Group to which + * the server belongs. + * + * @param {string} vaultName Name of the vault + * + * @param {object} parameters Parameters to create or update the vault + * + * @param {string} parameters.location The supported Azure location where the + * key vault should be created. + * + * @param {object} [parameters.tags] The tags that will be assigned to the key + * vault. + * + * @param {object} parameters.properties Properties of the vault + * + * @param {string} [parameters.properties.vaultUri] The URI of the vault for + * performing operations on keys and secrets. + * + * @param {uuid} parameters.properties.tenantId The Azure Active Directory + * tenant ID that should be used for authenticating requests to the key vault. + * + * @param {object} parameters.properties.sku SKU details + * + * @param {string} parameters.properties.sku.name SKU name to specify whether + * the key vault is a standard vault or a premium vault. Possible values + * include: 'standard', 'premium' + * + * @param {array} parameters.properties.accessPolicies An array of 0 to 16 + * identities that have access to the key vault. All identities in the array + * must use the same tenant ID as the key vault's tenant ID. + * + * @param {boolean} [parameters.properties.enabledForDeployment] Property to + * specify whether Azure Virtual Machines are permitted to retrieve + * certificates stored as secrets from the key vault. + * + * @param {boolean} [parameters.properties.enabledForDiskEncryption] Property + * to specify whether Azure Disk Encryption is permitted to retrieve secrets + * from the vault and unwrap keys. + * + * @param {boolean} [parameters.properties.enabledForTemplateDeployment] + * Property to specify whether Azure Resource Manager is permitted to + * retrieve secrets from the key vault. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link Vault} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +Vaults.prototype.createOrUpdate = function (resourceGroupName, vaultName, parameters, options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + if (parameters === null || parameters === undefined) + { + parameters = {}; + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vaultName === null || vaultName === undefined || typeof vaultName.valueOf() !== 'string') { + throw new Error('vaultName cannot be null or undefined and it must be of type string.'); + } + if (vaultName !== null && vaultName !== undefined) { + if (vaultName.match(/^[a-zA-Z0-9-]{3,24}$/) === null) + { + throw new Error('"vaultName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9-]{3,24}$/'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = this.client.baseUri + + '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vaultName}', encodeURIComponent(vaultName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + // Serialize Request + var requestContent = null; + var requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + var requestModelMapper = new client.models['VaultCreateOrUpdateParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + var serializationError = new Error(util.format('Error "%s" occurred in serializing the ' + + 'payload - "%s"', error.message, util.inspect(parameters, {depth: null}))); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 201 && statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 201) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['Vault']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['Vault']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError1 = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Deletes the specified Azure key vault. + * + * @param {string} resourceGroupName The name of the Resource Group to which + * the vault belongs. + * + * @param {string} vaultName The name of the vault to delete + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +Vaults.prototype.deleteMethod = function (resourceGroupName, vaultName, options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vaultName === null || vaultName === undefined || typeof vaultName.valueOf() !== 'string') { + throw new Error('vaultName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = this.client.baseUri + + '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vaultName}', encodeURIComponent(vaultName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * Gets the specified Azure key vault. + * + * @param {string} resourceGroupName The name of the Resource Group to which + * the vault belongs. + * + * @param {string} vaultName The name of the vault. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link Vault} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +Vaults.prototype.get = function (resourceGroupName, vaultName, options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (vaultName === null || vaultName === undefined || typeof vaultName.valueOf() !== 'string') { + throw new Error('vaultName cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = this.client.baseUri + + '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{vaultName}', encodeURIComponent(vaultName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + var queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['Vault']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * The List operation gets information about the vaults associated with the + * subscription and within the specified resource group. + * + * @param {string} resourceGroupName The name of the Resource Group to which + * the vault belongs. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.top] Maximum number of results to return. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link VaultListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +Vaults.prototype.listByResourceGroup = function (resourceGroupName, options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + var top = (options && options.top !== undefined) ? options.top : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (top !== null && top !== undefined && typeof top !== 'number') { + throw new Error('top must be of type number.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = this.client.baseUri + + '//subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + var queryParameters = []; + if (top !== null && top !== undefined) { + queryParameters.push('$top=' + encodeURIComponent(top.toString())); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['VaultListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * The List operation gets information about the vaults associated with the + * subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.top] Maximum number of results to return. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link VaultListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +Vaults.prototype.list = function (options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + var top = (options && options.top !== undefined) ? options.top : undefined; + var filter = 'resourceType eq \'Microsoft.KeyVault/vaults\''; + var apiVersion = '2015-11-01'; + // Validate + try { + if (top !== null && top !== undefined && typeof top !== 'number') { + throw new Error('top must be of type number.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = this.client.baseUri + + '//subscriptions/{subscriptionId}/resources'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + var queryParameters = []; + queryParameters.push('$filter=' + encodeURIComponent(filter)); + if (top !== null && top !== undefined) { + queryParameters.push('$top=' + encodeURIComponent(top.toString())); + } + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['VaultListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * The List operation gets information about the vaults associated with the + * subscription and within the specified resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link VaultListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +Vaults.prototype.listByResourceGroupNext = function (nextPageLink, options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['VaultListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + +/** + * The List operation gets information about the vaults associated with the + * subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object. + * See {@link VaultListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +Vaults.prototype.listNext = function (nextPageLink, options, callback) { + var client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + var requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + // Create HTTP transport objects + var httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.headers = {}; + httpRequest.url = requestUrl; + // Set Headers + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(var headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, function (err, response, responseBody) { + if (err) { + return callback(err); + } + var statusCode = response.statusCode; + if (statusCode !== 200) { + var error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + var resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error); + } + return callback(error); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new client.models['VaultListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +}; + + +module.exports = Vaults; diff --git a/lib/services/keyVaultManagement/package.json b/lib/services/keyVaultManagement/package.json index 012d6820e..2a3f7fa0e 100644 --- a/lib/services/keyVaultManagement/package.json +++ b/lib/services/keyVaultManagement/package.json @@ -5,12 +5,13 @@ "Colombo, Fernando ", "Gupta, Divya ", "Kostal, Greg ", + "Mortazavi, Pooneh ", "Wilson, Hervey ", "Zavery, Amar ", "Wang, Yugang " ], - "version": "0.11.1", - "description": "Microsoft Azure Key Vault Client Library for node", + "version": "0.11.2", + "description": "Microsoft Azure Key Vault Management Client Library for node", "tags": [ "azure", "sdk" @@ -19,7 +20,7 @@ "node", "azure" ], - "main": "./lib/keyVault.js", + "main": "./lib/keyVaultManagementClient.js", "licenses": [ { "type": "Apache 2.0", @@ -27,7 +28,9 @@ } ], "dependencies": { - "azure-common": "^0.9.13" + "ms-rest": "^1.14.0", + "ms-rest-azure": "^1.14.0", + "underscore": "^1.4.0" }, "homepage": "http://github.com/Azure/azure-sdk-for-node", "repository": { diff --git a/nodeSDK.njsproj b/nodeSDK.njsproj index 8f77b9d41..503f8584e 100644 --- a/nodeSDK.njsproj +++ b/nodeSDK.njsproj @@ -295,6 +295,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -888,7 +942,6 @@ - @@ -939,6 +992,8 @@ + + @@ -1433,6 +1488,19 @@ Mocha + + Mocha + + + Mocha + + + Mocha + + + + + @@ -1574,6 +1642,7 @@ + @@ -1918,6 +1987,7 @@ + diff --git a/test/recordings/keyVault-certificate-tests.nock.js b/test/recordings/keyVault-certificate-tests.nock.js new file mode 100644 index 000000000..435c9eea1 --- /dev/null +++ b/test/recordings/keyVault-certificate-tests.nock.js @@ -0,0 +1,2603 @@ +// This file has been autogenerated. + +exports.scopes = [[], +[function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.post('/certificates/nodeCertificate/create?api-version=2015-06-01', '*') + .reply(202, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/nodeCertificate/pending\",\"issuer\":{\"name\":\"Self\"},\"csr\":\"MIICqjCCAZICAQAwGjEYMBYGA1UEAwwPKi5taWNyb3NvZnQuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArCc0PqvcL/BVBLFITd8Qt95poSyEDE6xepn7epUph8j5/sqcPcvO+dcOPtkIII5sF1jbTpolRrAYherE6PaMYlsmHfzqmfEVJunmGkbNi1RcGBZl4RMu9QGYMJRnz5Qab5n/JARLNLq+xc2tzuxKOFq/ojHgNNYUvLwSSkkQN3o4iGg7iEnsqlOYsR43Nc0eflg4f93Peae4q+fRMuZ4QU67J8GC2zWrZBt1Z7QYfHla//fJyIEW7jIffKSxOriV3hy6C8G2khLrED5iSO2/GgqXBwrkMqvb1fXu3DCPvjk+YhN1nPMTdBkO++JL6lQAUqSetwVEuRgqqh88zVsjNQIDAQABoEswSQYJKoZIhvcNAQkOMTwwOjAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMAkGA1UdEwQCMAAwDQYJKoZIhvcNAQELBQADggEBAHNOhgPI+jLenZENn+prQ/7cPq5ajJhpPBub+VihRVkuTbXZxMNe3zlMPmM0eTEBU91nc3lrw+GuIfk5zR9l9I8BC2tKNJHsoiJ7NOOCxoiE3dr90YmqY449Rn5yx+V2BAesb/JYR94DY0dMOn4c54ihtRQUT9ybgCLVO+NQOXJNO85QrVh8G/GolWx9mae6Eg8z9lzd0bNiJKdd/gDUyzoN83JKPNAs7uJeT4Y7BlA6SqRMekUGQVmm3koEzrpz8rd4ThwEy6KVlHGi31ShTwMkOXvQuawuU2q2VRYyJTRe8PifX1MiQKQG/0unye//PjIBsGX8D7+FQKoPSaBvylw=\",\"cancellation_requested\":false,\"status\":\"inProgress\",\"status_details\":\"Pending certificate created. Certificate request is in progress. This may take some time based on the issuer provider. Please check again later.\",\"request_id\":\"8fdbf8566f40434a9ba1b421dbb6b828\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + location: 'https://sdktestvault0511.vault.azure.net/certificates/nodeCertificate/pending?api-version=2015-06-01&request_id=8fdbf8566f40434a9ba1b421dbb6b828', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '5b70f5f4-5973-4b2d-88a7-c931e26b12f4', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:07:57 GMT', + connection: 'close', + 'content-length': '1301' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.post('/certificates/nodeCertificate/create?api-version=2015-06-01', '*') + .reply(202, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/nodeCertificate/pending\",\"issuer\":{\"name\":\"Self\"},\"csr\":\"MIICqjCCAZICAQAwGjEYMBYGA1UEAwwPKi5taWNyb3NvZnQuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArCc0PqvcL/BVBLFITd8Qt95poSyEDE6xepn7epUph8j5/sqcPcvO+dcOPtkIII5sF1jbTpolRrAYherE6PaMYlsmHfzqmfEVJunmGkbNi1RcGBZl4RMu9QGYMJRnz5Qab5n/JARLNLq+xc2tzuxKOFq/ojHgNNYUvLwSSkkQN3o4iGg7iEnsqlOYsR43Nc0eflg4f93Peae4q+fRMuZ4QU67J8GC2zWrZBt1Z7QYfHla//fJyIEW7jIffKSxOriV3hy6C8G2khLrED5iSO2/GgqXBwrkMqvb1fXu3DCPvjk+YhN1nPMTdBkO++JL6lQAUqSetwVEuRgqqh88zVsjNQIDAQABoEswSQYJKoZIhvcNAQkOMTwwOjAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMAkGA1UdEwQCMAAwDQYJKoZIhvcNAQELBQADggEBAHNOhgPI+jLenZENn+prQ/7cPq5ajJhpPBub+VihRVkuTbXZxMNe3zlMPmM0eTEBU91nc3lrw+GuIfk5zR9l9I8BC2tKNJHsoiJ7NOOCxoiE3dr90YmqY449Rn5yx+V2BAesb/JYR94DY0dMOn4c54ihtRQUT9ybgCLVO+NQOXJNO85QrVh8G/GolWx9mae6Eg8z9lzd0bNiJKdd/gDUyzoN83JKPNAs7uJeT4Y7BlA6SqRMekUGQVmm3koEzrpz8rd4ThwEy6KVlHGi31ShTwMkOXvQuawuU2q2VRYyJTRe8PifX1MiQKQG/0unye//PjIBsGX8D7+FQKoPSaBvylw=\",\"cancellation_requested\":false,\"status\":\"inProgress\",\"status_details\":\"Pending certificate created. Certificate request is in progress. This may take some time based on the issuer provider. Please check again later.\",\"request_id\":\"8fdbf8566f40434a9ba1b421dbb6b828\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + location: 'https://sdktestvault0511.vault.azure.net/certificates/nodeCertificate/pending?api-version=2015-06-01&request_id=8fdbf8566f40434a9ba1b421dbb6b828', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '5b70f5f4-5973-4b2d-88a7-c931e26b12f4', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:07:57 GMT', + connection: 'close', + 'content-length': '1301' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates/nodeCertificate/pending?api-version=2015-06-01') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/nodeCertificate/pending\",\"issuer\":{\"name\":\"Self\"},\"csr\":\"MIICqjCCAZICAQAwGjEYMBYGA1UEAwwPKi5taWNyb3NvZnQuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArCc0PqvcL/BVBLFITd8Qt95poSyEDE6xepn7epUph8j5/sqcPcvO+dcOPtkIII5sF1jbTpolRrAYherE6PaMYlsmHfzqmfEVJunmGkbNi1RcGBZl4RMu9QGYMJRnz5Qab5n/JARLNLq+xc2tzuxKOFq/ojHgNNYUvLwSSkkQN3o4iGg7iEnsqlOYsR43Nc0eflg4f93Peae4q+fRMuZ4QU67J8GC2zWrZBt1Z7QYfHla//fJyIEW7jIffKSxOriV3hy6C8G2khLrED5iSO2/GgqXBwrkMqvb1fXu3DCPvjk+YhN1nPMTdBkO++JL6lQAUqSetwVEuRgqqh88zVsjNQIDAQABoEswSQYJKoZIhvcNAQkOMTwwOjAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMAkGA1UdEwQCMAAwDQYJKoZIhvcNAQELBQADggEBAHNOhgPI+jLenZENn+prQ/7cPq5ajJhpPBub+VihRVkuTbXZxMNe3zlMPmM0eTEBU91nc3lrw+GuIfk5zR9l9I8BC2tKNJHsoiJ7NOOCxoiE3dr90YmqY449Rn5yx+V2BAesb/JYR94DY0dMOn4c54ihtRQUT9ybgCLVO+NQOXJNO85QrVh8G/GolWx9mae6Eg8z9lzd0bNiJKdd/gDUyzoN83JKPNAs7uJeT4Y7BlA6SqRMekUGQVmm3koEzrpz8rd4ThwEy6KVlHGi31ShTwMkOXvQuawuU2q2VRYyJTRe8PifX1MiQKQG/0unye//PjIBsGX8D7+FQKoPSaBvylw=\",\"cancellation_requested\":false,\"status\":\"completed\",\"status_details\":\"\",\"target\":\"https://sdktestvault0511.vault.azure.net/certificates/nodeCertificate\",\"request_id\":\"8fdbf8566f40434a9ba1b421dbb6b828\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'cd001a8d-9678-4f7e-9a59-c4b36897dbdf', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:02 GMT', + connection: 'close', + 'content-length': '1237' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates/nodeCertificate/pending?api-version=2015-06-01') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/nodeCertificate/pending\",\"issuer\":{\"name\":\"Self\"},\"csr\":\"MIICqjCCAZICAQAwGjEYMBYGA1UEAwwPKi5taWNyb3NvZnQuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArCc0PqvcL/BVBLFITd8Qt95poSyEDE6xepn7epUph8j5/sqcPcvO+dcOPtkIII5sF1jbTpolRrAYherE6PaMYlsmHfzqmfEVJunmGkbNi1RcGBZl4RMu9QGYMJRnz5Qab5n/JARLNLq+xc2tzuxKOFq/ojHgNNYUvLwSSkkQN3o4iGg7iEnsqlOYsR43Nc0eflg4f93Peae4q+fRMuZ4QU67J8GC2zWrZBt1Z7QYfHla//fJyIEW7jIffKSxOriV3hy6C8G2khLrED5iSO2/GgqXBwrkMqvb1fXu3DCPvjk+YhN1nPMTdBkO++JL6lQAUqSetwVEuRgqqh88zVsjNQIDAQABoEswSQYJKoZIhvcNAQkOMTwwOjAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMAkGA1UdEwQCMAAwDQYJKoZIhvcNAQELBQADggEBAHNOhgPI+jLenZENn+prQ/7cPq5ajJhpPBub+VihRVkuTbXZxMNe3zlMPmM0eTEBU91nc3lrw+GuIfk5zR9l9I8BC2tKNJHsoiJ7NOOCxoiE3dr90YmqY449Rn5yx+V2BAesb/JYR94DY0dMOn4c54ihtRQUT9ybgCLVO+NQOXJNO85QrVh8G/GolWx9mae6Eg8z9lzd0bNiJKdd/gDUyzoN83JKPNAs7uJeT4Y7BlA6SqRMekUGQVmm3koEzrpz8rd4ThwEy6KVlHGi31ShTwMkOXvQuawuU2q2VRYyJTRe8PifX1MiQKQG/0unye//PjIBsGX8D7+FQKoPSaBvylw=\",\"cancellation_requested\":false,\"status\":\"completed\",\"status_details\":\"\",\"target\":\"https://sdktestvault0511.vault.azure.net/certificates/nodeCertificate\",\"request_id\":\"8fdbf8566f40434a9ba1b421dbb6b828\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'cd001a8d-9678-4f7e-9a59-c4b36897dbdf', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:02 GMT', + connection: 'close', + 'content-length': '1237' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.patch('/certificates/nodeCertificate/?api-version=2015-06-01', '*') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/nodeCertificate/8cdf2990db2d47588122682e8b361bf9\",\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeCertificate/8cdf2990db2d47588122682e8b361bf9\",\"sid\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeCertificate/8cdf2990db2d47588122682e8b361bf9\",\"x5t\":\"J_Ubi2k5Rgn9GdjN1kBZC1DoDtE\",\"cer\":\"MIIDOjCCAiKgAwIBAgIQPQm9uZ4kQDGFpRDui5GW3zANBgkqhkiG9w0BAQsFADAaMRgwFgYDVQQDDA8qLm1pY3Jvc29mdC5jb20wHhcNMTYwODEyMjE1ODAyWhcNMTgwODEyMjIwODAyWjAaMRgwFgYDVQQDDA8qLm1pY3Jvc29mdC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCsJzQ+q9wv8FUEsUhN3xC33mmhLIQMTrF6mft6lSmHyPn+ypw9y8751w4+2QggjmwXWNtOmiVGsBiF6sTo9oxiWyYd/OqZ8RUm6eYaRs2LVFwYFmXhEy71AZgwlGfPlBpvmf8kBEs0ur7Fza3O7Eo4Wr+iMeA01hS8vBJKSRA3ejiIaDuISeyqU5ixHjc1zR5+WDh/3c95p7ir59Ey5nhBTrsnwYLbNatkG3VntBh8eVr/98nIgRbuMh98pLE6uJXeHLoLwbaSEusQPmJI7b8aCpcHCuQyq9vV9e7cMI++OT5iE3Wc8xN0GQ774kvqVABSpJ63BUS5GCqqHzzNWyM1AgMBAAGjfDB6MA4GA1UdDwEB/wQEAwIFoDAJBgNVHRMEAjAAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAfBgNVHSMEGDAWgBQ9hJaRvMrPNHYEedFXB0sKwgeagDAdBgNVHQ4EFgQUPYSWkbzKzzR2BHnRVwdLCsIHmoAwDQYJKoZIhvcNAQELBQADggEBAAk07TEyJySY2mzWVBVW47w2y0YARn/94JbR3EVg/dSoc/dRUDZ2uzPhr1uPmxgHeY8VoNSjpDsBEMytFBMGC8BcLroJh+6ysI7ZnEfheYrrOc3J/Ld+JRD9bQXcCdWPRp95pdGWYAWXB73duE5/hH3c1XqN8I1izC6dn230TWP/76cUwfVsqOtrQNzNnrMX4akWQ3PsMapuW8Iz4Xv8fo9EqdEbsf5VHLVPumEateivcln0Reeinf1/3QZpgQEe6VSHx2TKsWMeWjpivNMp2MY0JuVM+mGloEzksKWLIPynN7t0WuoTWcJnz0fFMqvDIsSfGUS2n6m1afTGyQc3MZM=\",\"attributes\":{\"enabled\":true,\"nbf\":1471039082,\"exp\":1534111682,\"created\":1471039682,\"updated\":1471039683},\"tags\":{\"tag1\":\"value1\"},\"policy\":{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/nodeCertificate/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=*.microsoft.com\",\"sans\":{},\"ekus\":[\"1.3.6.1.5.5.7.3.1\",\"1.3.6.1.5.5.7.3.2\"],\"key_usage\":[\"digitalSignature\",\"keyEncipherment\"],\"validity_months\":24,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"AutoRenew\"}}],\"issuer\":{\"name\":\"Self\"},\"attributes\":{\"enabled\":true,\"created\":1471039676,\"updated\":1471039676}},\"pending\":{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/nodeCertificate/pending\"}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'fe4a0440-ca2b-4ede-9fe6-4a630e071ae4', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:03 GMT', + connection: 'close', + 'content-length': '2332' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.patch('/certificates/nodeCertificate/?api-version=2015-06-01', '*') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/nodeCertificate/8cdf2990db2d47588122682e8b361bf9\",\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeCertificate/8cdf2990db2d47588122682e8b361bf9\",\"sid\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeCertificate/8cdf2990db2d47588122682e8b361bf9\",\"x5t\":\"J_Ubi2k5Rgn9GdjN1kBZC1DoDtE\",\"cer\":\"MIIDOjCCAiKgAwIBAgIQPQm9uZ4kQDGFpRDui5GW3zANBgkqhkiG9w0BAQsFADAaMRgwFgYDVQQDDA8qLm1pY3Jvc29mdC5jb20wHhcNMTYwODEyMjE1ODAyWhcNMTgwODEyMjIwODAyWjAaMRgwFgYDVQQDDA8qLm1pY3Jvc29mdC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCsJzQ+q9wv8FUEsUhN3xC33mmhLIQMTrF6mft6lSmHyPn+ypw9y8751w4+2QggjmwXWNtOmiVGsBiF6sTo9oxiWyYd/OqZ8RUm6eYaRs2LVFwYFmXhEy71AZgwlGfPlBpvmf8kBEs0ur7Fza3O7Eo4Wr+iMeA01hS8vBJKSRA3ejiIaDuISeyqU5ixHjc1zR5+WDh/3c95p7ir59Ey5nhBTrsnwYLbNatkG3VntBh8eVr/98nIgRbuMh98pLE6uJXeHLoLwbaSEusQPmJI7b8aCpcHCuQyq9vV9e7cMI++OT5iE3Wc8xN0GQ774kvqVABSpJ63BUS5GCqqHzzNWyM1AgMBAAGjfDB6MA4GA1UdDwEB/wQEAwIFoDAJBgNVHRMEAjAAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAfBgNVHSMEGDAWgBQ9hJaRvMrPNHYEedFXB0sKwgeagDAdBgNVHQ4EFgQUPYSWkbzKzzR2BHnRVwdLCsIHmoAwDQYJKoZIhvcNAQELBQADggEBAAk07TEyJySY2mzWVBVW47w2y0YARn/94JbR3EVg/dSoc/dRUDZ2uzPhr1uPmxgHeY8VoNSjpDsBEMytFBMGC8BcLroJh+6ysI7ZnEfheYrrOc3J/Ld+JRD9bQXcCdWPRp95pdGWYAWXB73duE5/hH3c1XqN8I1izC6dn230TWP/76cUwfVsqOtrQNzNnrMX4akWQ3PsMapuW8Iz4Xv8fo9EqdEbsf5VHLVPumEateivcln0Reeinf1/3QZpgQEe6VSHx2TKsWMeWjpivNMp2MY0JuVM+mGloEzksKWLIPynN7t0WuoTWcJnz0fFMqvDIsSfGUS2n6m1afTGyQc3MZM=\",\"attributes\":{\"enabled\":true,\"nbf\":1471039082,\"exp\":1534111682,\"created\":1471039682,\"updated\":1471039683},\"tags\":{\"tag1\":\"value1\"},\"policy\":{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/nodeCertificate/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=*.microsoft.com\",\"sans\":{},\"ekus\":[\"1.3.6.1.5.5.7.3.1\",\"1.3.6.1.5.5.7.3.2\"],\"key_usage\":[\"digitalSignature\",\"keyEncipherment\"],\"validity_months\":24,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"AutoRenew\"}}],\"issuer\":{\"name\":\"Self\"},\"attributes\":{\"enabled\":true,\"created\":1471039676,\"updated\":1471039676}},\"pending\":{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/nodeCertificate/pending\"}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'fe4a0440-ca2b-4ede-9fe6-4a630e071ae4', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:03 GMT', + connection: 'close', + 'content-length': '2332' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates/nodeCertificate/?api-version=2015-06-01') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/nodeCertificate/8cdf2990db2d47588122682e8b361bf9\",\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeCertificate/8cdf2990db2d47588122682e8b361bf9\",\"sid\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeCertificate/8cdf2990db2d47588122682e8b361bf9\",\"x5t\":\"J_Ubi2k5Rgn9GdjN1kBZC1DoDtE\",\"cer\":\"MIIDOjCCAiKgAwIBAgIQPQm9uZ4kQDGFpRDui5GW3zANBgkqhkiG9w0BAQsFADAaMRgwFgYDVQQDDA8qLm1pY3Jvc29mdC5jb20wHhcNMTYwODEyMjE1ODAyWhcNMTgwODEyMjIwODAyWjAaMRgwFgYDVQQDDA8qLm1pY3Jvc29mdC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCsJzQ+q9wv8FUEsUhN3xC33mmhLIQMTrF6mft6lSmHyPn+ypw9y8751w4+2QggjmwXWNtOmiVGsBiF6sTo9oxiWyYd/OqZ8RUm6eYaRs2LVFwYFmXhEy71AZgwlGfPlBpvmf8kBEs0ur7Fza3O7Eo4Wr+iMeA01hS8vBJKSRA3ejiIaDuISeyqU5ixHjc1zR5+WDh/3c95p7ir59Ey5nhBTrsnwYLbNatkG3VntBh8eVr/98nIgRbuMh98pLE6uJXeHLoLwbaSEusQPmJI7b8aCpcHCuQyq9vV9e7cMI++OT5iE3Wc8xN0GQ774kvqVABSpJ63BUS5GCqqHzzNWyM1AgMBAAGjfDB6MA4GA1UdDwEB/wQEAwIFoDAJBgNVHRMEAjAAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAfBgNVHSMEGDAWgBQ9hJaRvMrPNHYEedFXB0sKwgeagDAdBgNVHQ4EFgQUPYSWkbzKzzR2BHnRVwdLCsIHmoAwDQYJKoZIhvcNAQELBQADggEBAAk07TEyJySY2mzWVBVW47w2y0YARn/94JbR3EVg/dSoc/dRUDZ2uzPhr1uPmxgHeY8VoNSjpDsBEMytFBMGC8BcLroJh+6ysI7ZnEfheYrrOc3J/Ld+JRD9bQXcCdWPRp95pdGWYAWXB73duE5/hH3c1XqN8I1izC6dn230TWP/76cUwfVsqOtrQNzNnrMX4akWQ3PsMapuW8Iz4Xv8fo9EqdEbsf5VHLVPumEateivcln0Reeinf1/3QZpgQEe6VSHx2TKsWMeWjpivNMp2MY0JuVM+mGloEzksKWLIPynN7t0WuoTWcJnz0fFMqvDIsSfGUS2n6m1afTGyQc3MZM=\",\"attributes\":{\"enabled\":true,\"nbf\":1471039082,\"exp\":1534111682,\"created\":1471039682,\"updated\":1471039683},\"tags\":{\"tag1\":\"value1\"},\"policy\":{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/nodeCertificate/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=*.microsoft.com\",\"sans\":{},\"ekus\":[\"1.3.6.1.5.5.7.3.1\",\"1.3.6.1.5.5.7.3.2\"],\"key_usage\":[\"digitalSignature\",\"keyEncipherment\"],\"validity_months\":24,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"AutoRenew\"}}],\"issuer\":{\"name\":\"Self\"},\"attributes\":{\"enabled\":true,\"created\":1471039676,\"updated\":1471039676}},\"pending\":{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/nodeCertificate/pending\"}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'd973a6e5-48e2-41e8-92a4-937c259267c3', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:04 GMT', + connection: 'close', + 'content-length': '2332' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates/nodeCertificate/?api-version=2015-06-01') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/nodeCertificate/8cdf2990db2d47588122682e8b361bf9\",\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeCertificate/8cdf2990db2d47588122682e8b361bf9\",\"sid\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeCertificate/8cdf2990db2d47588122682e8b361bf9\",\"x5t\":\"J_Ubi2k5Rgn9GdjN1kBZC1DoDtE\",\"cer\":\"MIIDOjCCAiKgAwIBAgIQPQm9uZ4kQDGFpRDui5GW3zANBgkqhkiG9w0BAQsFADAaMRgwFgYDVQQDDA8qLm1pY3Jvc29mdC5jb20wHhcNMTYwODEyMjE1ODAyWhcNMTgwODEyMjIwODAyWjAaMRgwFgYDVQQDDA8qLm1pY3Jvc29mdC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCsJzQ+q9wv8FUEsUhN3xC33mmhLIQMTrF6mft6lSmHyPn+ypw9y8751w4+2QggjmwXWNtOmiVGsBiF6sTo9oxiWyYd/OqZ8RUm6eYaRs2LVFwYFmXhEy71AZgwlGfPlBpvmf8kBEs0ur7Fza3O7Eo4Wr+iMeA01hS8vBJKSRA3ejiIaDuISeyqU5ixHjc1zR5+WDh/3c95p7ir59Ey5nhBTrsnwYLbNatkG3VntBh8eVr/98nIgRbuMh98pLE6uJXeHLoLwbaSEusQPmJI7b8aCpcHCuQyq9vV9e7cMI++OT5iE3Wc8xN0GQ774kvqVABSpJ63BUS5GCqqHzzNWyM1AgMBAAGjfDB6MA4GA1UdDwEB/wQEAwIFoDAJBgNVHRMEAjAAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAfBgNVHSMEGDAWgBQ9hJaRvMrPNHYEedFXB0sKwgeagDAdBgNVHQ4EFgQUPYSWkbzKzzR2BHnRVwdLCsIHmoAwDQYJKoZIhvcNAQELBQADggEBAAk07TEyJySY2mzWVBVW47w2y0YARn/94JbR3EVg/dSoc/dRUDZ2uzPhr1uPmxgHeY8VoNSjpDsBEMytFBMGC8BcLroJh+6ysI7ZnEfheYrrOc3J/Ld+JRD9bQXcCdWPRp95pdGWYAWXB73duE5/hH3c1XqN8I1izC6dn230TWP/76cUwfVsqOtrQNzNnrMX4akWQ3PsMapuW8Iz4Xv8fo9EqdEbsf5VHLVPumEateivcln0Reeinf1/3QZpgQEe6VSHx2TKsWMeWjpivNMp2MY0JuVM+mGloEzksKWLIPynN7t0WuoTWcJnz0fFMqvDIsSfGUS2n6m1afTGyQc3MZM=\",\"attributes\":{\"enabled\":true,\"nbf\":1471039082,\"exp\":1534111682,\"created\":1471039682,\"updated\":1471039683},\"tags\":{\"tag1\":\"value1\"},\"policy\":{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/nodeCertificate/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=*.microsoft.com\",\"sans\":{},\"ekus\":[\"1.3.6.1.5.5.7.3.1\",\"1.3.6.1.5.5.7.3.2\"],\"key_usage\":[\"digitalSignature\",\"keyEncipherment\"],\"validity_months\":24,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"AutoRenew\"}}],\"issuer\":{\"name\":\"Self\"},\"attributes\":{\"enabled\":true,\"created\":1471039676,\"updated\":1471039676}},\"pending\":{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/nodeCertificate/pending\"}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'd973a6e5-48e2-41e8-92a4-937c259267c3', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:04 GMT', + connection: 'close', + 'content-length': '2332' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/secrets/nodeCertificate/8cdf2990db2d47588122682e8b361bf9?api-version=2015-06-01') + .reply(200, "{\"value\":\"MIIKRAIBAzCCCgQGCSqGSIb3DQEHAaCCCfUEggnxMIIJ7TCCBhYGCSqGSIb3DQEHAaCCBgcEggYDMIIF/zCCBfsGCyqGSIb3DQEMCgECoIIE/jCCBPowHAYKKoZIhvcNAQwBAzAOBAitIf73qGR4pwICB9AEggTYH5qwEwXY2r9RjvqP/pFMWbbWa4LmOtwogQy/WRNiWXN49fhFXEaiNk1EAIlXW1+cMct/vmTaSiU9aPTYlWs/mgvNBEuNm8JURMGjaxxUSpQR4xyE7hItbJwUho9TWths7RHmGM9tx+aG8hnPho6zeCkEfVH6Ud3lvFGYpdXSbkRfey5e3xu4rThJV7EceoFPLzwdQb39qrXU2psngTI0j7JxUl2Fmvd15Rpr/Yrcw6vVQku7MP3px4a2X0/NKT30rolDCwMusCgDODz+FJU2ERYVX2GJ7cZt0NBDO1WD4sQ0qdxOCqEHqTKf0ZNQFv+SVtbIARQWLQipQ12OLSopT9AzLdGnp9fLAqyjrA6nnGcUvSfoglxePHgs38whwrOXZDH0Xx8GW+d7Wlhu8SdPgcxvWz5aPjQ/eq1/5z2Gm//atYXRP/NIjVaoatVKJkIWzrRha9N3BHYmvqSbEq3OJQJUrvOLWNdZ4buQBXSLDOJCjok78gKjDmDGUZd2YCTIxPqprAVZVir0D1dqarDzKvpz0lbpKwDXYpkUimNCTXM9mYLG81GsMOBWPjdm+u69N5eEyCgi3TFKA6hJ9s/Clzys++2GNs5LXkBhZxFLTnoKV3uWWcQ7WPMKWr8gzOlvuLhRXx4XIk+//txMMBhGQ27FMwgQEYm/dSQsjoPg95/iEX19SJJK2rBaFX5VeKQdIrK4fQIOGiTqCLA/iawQa+DhhKZX6mAFHnwaT9Bf0sUjmltXiPycOHPPMYFpuhkdB4QaUaunOZpxYgcMCrIBfOm9ho8Q6VpQBPUPwee/nV345wUb3s/Ofap0IwJtxJDKxW3R56Q19GrsWBbnCSIeCgfHF+3Y2NrAW9ycj0YSPUDPeSpnQvMXoUnCfkmnzuvNKi5HAhAgpforKlS4thyd8gkFv7NjvhhOLW8OQumDsktMKpbT4lWcnJccfyULimJlBfWjxSnp6RFsMMTmAs2TR4uUzE253v3NU1Cpw83lKGRpDTJ8HxYyClMVi/ujudypko52KCa/CaqYaNxXnpU7jpGYj5fIPUNg+StWdafBtSNjAUoTqI0xs1buEtfFfeUmUxCu1ttPA+71Pl39I4Dvir2hnuc3j8i2m94MfVCqqJtkCsMPVjrlu9DKtWKeF9BuKqOJjf4dypzaSRO0a1QT4SDKfOIY+z9k8QePB9U7ZTD48BjCd9CK4vlwBfnux5/yLMqeRKucvkYC5whpub/UjDSEVXCroiLCm7u9gyRfzhV1HFB2O73UHH8OqwmeWtF6A5lPl4J8KfC0dieW4l3dcWUmQ3XhOSNEVrekBLN707dR0+Y/lDpeBEx6W5Fd3Q4po1vlxbtT5exaMvftsd/6752RKAvRSFc442F58f3oz76xSoYweAV37Jo1DE//G6dEN4oLzPUlsgWVBXFgt+eaw1XHzl5GQ9aVQzgt15Qb+ROYK/Lg0VXmicN63fYN1HWWcl1VkkeEld5h8emHQBuTSiPyO4z5juYqKWVZ2Ia9pxZS8Bzx80Qzs7U4Zc6IMdh2qWgMyoQDmRQXKg4KV08Xj87IB6KvARjTtzkTvQhHOjNOCoJGNTIzdYxs44DA1fED5IU/A2w+HN0qn6OTTmPvpUkv7ziY1aPNvc4BZlhoJOgux1gDEmGSWjGB6TATBgkqhkiG9w0BCRUxBgQEAQAAADBXBgkqhkiG9w0BCRQxSh5IADYAMgA3ADMANABlADIAOQAtAGMAZQBlAGMALQA0ADYANgA4AC0AOAAzADQAOQAtADUAZABmADQAYwAyAGEAOAAxAGYAMQA1MHkGCSsGAQQBgjcRATFsHmoATQBpAGMAcgBvAHMAbwBmAHQAIABFAG4AaABhAG4AYwBlAGQAIABSAFMAQQAgAGEAbgBkACAAQQBFAFMAIABDAHIAeQBwAHQAbwBnAHIAYQBwAGgAaQBjACAAUAByAG8AdgBpAGQAZQByMIIDzwYJKoZIhvcNAQcGoIIDwDCCA7wCAQAwggO1BgkqhkiG9w0BBwEwHAYKKoZIhvcNAQwBBjAOBAjqUgCECJNCCQICB9CAggOIaWdYsk4/av8+Su3795yWzws4OabWraic+/XMErKDtJcW+mzSPhMhGKfphmVYJImtLfE0c3sp4T5NkJXnrFPhpcEPhGC8kZlPO2uUUFXQOV40+UDadMhnsRqn3f+Mx52b3qRAHVPiIKwREnGRVBQfeodEwmPvMhO+sl9JFPoFQ5u24SfVZ5dH86J+DrcuGFUT+VVhKCHfBnV0Yoo+9ImH3XmZ+zmclWaJG18T7XSU2ALeTXFi5fSzy+ai7bLcAMJpfrlWQEHd7RKZtydiXcy5EruXyuBrfWW5DaH2zyaa4gtXmmG9EcA6BQ8yjzG+GAc+HkldwwKCTXQjXbjvinhbq5y8wJYgvHBcMLTg9AMkhhCU/SBYUkNt56urvad7AZaTy5l037S3iuj2Wc7xw/TAFfuazqDp8fUeuLf0s0+J4385xBE2w7j8WSaHW95bt2ULwN+mnjxPxk0jDP7fphKW/wlrNoT/OOUB/g8KPNVCKmLk22mzHsF9LPHalAbyc3pguFX7q87F90OizasL/XonHVpO3wuP1wDP3Dv+4R0TY8bhkl5MvPApw2/Bgvpn1R6Y/wuREdJgPBGCqQ2klk4I9uILv3XcUdRtVYCgNLrrdC5amJaF92XC8svWFND7hb0w0ECPGSRY2bcZZIHtGFnSQUK4+foKhZzxmGr0WZQzxGVSl5iYBR9a+gpvqGMynj01Q63jBxFnGNNd6H38Ea00dfe+ONA0L9Inu/SImZXsODPyG8ppPEOuezH+EsLV0jutbidXpduvUeq8mH1FyIrzc2ZL+jJdHQSbl9vcLB5QVERnMF5o+SEBrB0ENFkf80qJiyXKnBlu/w6rYsmaE1OQB0QVtW3N/pLvfwLghD9Mgjbls37m9m1gPBhZum0oTeMIFHk3ldyUKFizM17smanI9rjueJqsYwO5rDy3vQngYPm6DLuT4nLm9UMGKGmtp2ENc4WsTiJkQ6ktPHNGBnNltaODzh7rKzCqDR+DmfTmH2q9giN4JKHu6IgDOVm3I5UwTqVQFR+YstDW9bO91ERiyPQ1e+hHqcMDpw92Hf91XQdUJqCq3pLaPORPMNukj0baTndYQsLy9Vrb45Ihf9rgi971+kDDY9p07A4S1HmM+uVNJVZksKvP2Nx1ewpubPGrE+7rO5VzqIUPkvaHvGH9sQrQmiOkLg3HdMNEvdDZ7Qr9o5Czl4mZ7jA3MB8wBwYFKw4DAhoEFAK36LaYXc7YcYg6XD2a3LQn+JIwBBShse4lclEEl8cf0c74e7/7loMKjA==\",\"contentType\":\"application/x-pkcs12\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeCertificate/8cdf2990db2d47588122682e8b361bf9\",\"managed\":true,\"attributes\":{\"enabled\":true,\"nbf\":1471039082,\"exp\":1534111682,\"created\":1471039682,\"updated\":1471039683},\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeCertificate/8cdf2990db2d47588122682e8b361bf9\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '6696ecba-8638-42b9-aee1-eabf7e1c5925', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:04 GMT', + connection: 'close', + 'content-length': '3890' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/secrets/nodeCertificate/8cdf2990db2d47588122682e8b361bf9?api-version=2015-06-01') + .reply(200, "{\"value\":\"MIIKRAIBAzCCCgQGCSqGSIb3DQEHAaCCCfUEggnxMIIJ7TCCBhYGCSqGSIb3DQEHAaCCBgcEggYDMIIF/zCCBfsGCyqGSIb3DQEMCgECoIIE/jCCBPowHAYKKoZIhvcNAQwBAzAOBAitIf73qGR4pwICB9AEggTYH5qwEwXY2r9RjvqP/pFMWbbWa4LmOtwogQy/WRNiWXN49fhFXEaiNk1EAIlXW1+cMct/vmTaSiU9aPTYlWs/mgvNBEuNm8JURMGjaxxUSpQR4xyE7hItbJwUho9TWths7RHmGM9tx+aG8hnPho6zeCkEfVH6Ud3lvFGYpdXSbkRfey5e3xu4rThJV7EceoFPLzwdQb39qrXU2psngTI0j7JxUl2Fmvd15Rpr/Yrcw6vVQku7MP3px4a2X0/NKT30rolDCwMusCgDODz+FJU2ERYVX2GJ7cZt0NBDO1WD4sQ0qdxOCqEHqTKf0ZNQFv+SVtbIARQWLQipQ12OLSopT9AzLdGnp9fLAqyjrA6nnGcUvSfoglxePHgs38whwrOXZDH0Xx8GW+d7Wlhu8SdPgcxvWz5aPjQ/eq1/5z2Gm//atYXRP/NIjVaoatVKJkIWzrRha9N3BHYmvqSbEq3OJQJUrvOLWNdZ4buQBXSLDOJCjok78gKjDmDGUZd2YCTIxPqprAVZVir0D1dqarDzKvpz0lbpKwDXYpkUimNCTXM9mYLG81GsMOBWPjdm+u69N5eEyCgi3TFKA6hJ9s/Clzys++2GNs5LXkBhZxFLTnoKV3uWWcQ7WPMKWr8gzOlvuLhRXx4XIk+//txMMBhGQ27FMwgQEYm/dSQsjoPg95/iEX19SJJK2rBaFX5VeKQdIrK4fQIOGiTqCLA/iawQa+DhhKZX6mAFHnwaT9Bf0sUjmltXiPycOHPPMYFpuhkdB4QaUaunOZpxYgcMCrIBfOm9ho8Q6VpQBPUPwee/nV345wUb3s/Ofap0IwJtxJDKxW3R56Q19GrsWBbnCSIeCgfHF+3Y2NrAW9ycj0YSPUDPeSpnQvMXoUnCfkmnzuvNKi5HAhAgpforKlS4thyd8gkFv7NjvhhOLW8OQumDsktMKpbT4lWcnJccfyULimJlBfWjxSnp6RFsMMTmAs2TR4uUzE253v3NU1Cpw83lKGRpDTJ8HxYyClMVi/ujudypko52KCa/CaqYaNxXnpU7jpGYj5fIPUNg+StWdafBtSNjAUoTqI0xs1buEtfFfeUmUxCu1ttPA+71Pl39I4Dvir2hnuc3j8i2m94MfVCqqJtkCsMPVjrlu9DKtWKeF9BuKqOJjf4dypzaSRO0a1QT4SDKfOIY+z9k8QePB9U7ZTD48BjCd9CK4vlwBfnux5/yLMqeRKucvkYC5whpub/UjDSEVXCroiLCm7u9gyRfzhV1HFB2O73UHH8OqwmeWtF6A5lPl4J8KfC0dieW4l3dcWUmQ3XhOSNEVrekBLN707dR0+Y/lDpeBEx6W5Fd3Q4po1vlxbtT5exaMvftsd/6752RKAvRSFc442F58f3oz76xSoYweAV37Jo1DE//G6dEN4oLzPUlsgWVBXFgt+eaw1XHzl5GQ9aVQzgt15Qb+ROYK/Lg0VXmicN63fYN1HWWcl1VkkeEld5h8emHQBuTSiPyO4z5juYqKWVZ2Ia9pxZS8Bzx80Qzs7U4Zc6IMdh2qWgMyoQDmRQXKg4KV08Xj87IB6KvARjTtzkTvQhHOjNOCoJGNTIzdYxs44DA1fED5IU/A2w+HN0qn6OTTmPvpUkv7ziY1aPNvc4BZlhoJOgux1gDEmGSWjGB6TATBgkqhkiG9w0BCRUxBgQEAQAAADBXBgkqhkiG9w0BCRQxSh5IADYAMgA3ADMANABlADIAOQAtAGMAZQBlAGMALQA0ADYANgA4AC0AOAAzADQAOQAtADUAZABmADQAYwAyAGEAOAAxAGYAMQA1MHkGCSsGAQQBgjcRATFsHmoATQBpAGMAcgBvAHMAbwBmAHQAIABFAG4AaABhAG4AYwBlAGQAIABSAFMAQQAgAGEAbgBkACAAQQBFAFMAIABDAHIAeQBwAHQAbwBnAHIAYQBwAGgAaQBjACAAUAByAG8AdgBpAGQAZQByMIIDzwYJKoZIhvcNAQcGoIIDwDCCA7wCAQAwggO1BgkqhkiG9w0BBwEwHAYKKoZIhvcNAQwBBjAOBAjqUgCECJNCCQICB9CAggOIaWdYsk4/av8+Su3795yWzws4OabWraic+/XMErKDtJcW+mzSPhMhGKfphmVYJImtLfE0c3sp4T5NkJXnrFPhpcEPhGC8kZlPO2uUUFXQOV40+UDadMhnsRqn3f+Mx52b3qRAHVPiIKwREnGRVBQfeodEwmPvMhO+sl9JFPoFQ5u24SfVZ5dH86J+DrcuGFUT+VVhKCHfBnV0Yoo+9ImH3XmZ+zmclWaJG18T7XSU2ALeTXFi5fSzy+ai7bLcAMJpfrlWQEHd7RKZtydiXcy5EruXyuBrfWW5DaH2zyaa4gtXmmG9EcA6BQ8yjzG+GAc+HkldwwKCTXQjXbjvinhbq5y8wJYgvHBcMLTg9AMkhhCU/SBYUkNt56urvad7AZaTy5l037S3iuj2Wc7xw/TAFfuazqDp8fUeuLf0s0+J4385xBE2w7j8WSaHW95bt2ULwN+mnjxPxk0jDP7fphKW/wlrNoT/OOUB/g8KPNVCKmLk22mzHsF9LPHalAbyc3pguFX7q87F90OizasL/XonHVpO3wuP1wDP3Dv+4R0TY8bhkl5MvPApw2/Bgvpn1R6Y/wuREdJgPBGCqQ2klk4I9uILv3XcUdRtVYCgNLrrdC5amJaF92XC8svWFND7hb0w0ECPGSRY2bcZZIHtGFnSQUK4+foKhZzxmGr0WZQzxGVSl5iYBR9a+gpvqGMynj01Q63jBxFnGNNd6H38Ea00dfe+ONA0L9Inu/SImZXsODPyG8ppPEOuezH+EsLV0jutbidXpduvUeq8mH1FyIrzc2ZL+jJdHQSbl9vcLB5QVERnMF5o+SEBrB0ENFkf80qJiyXKnBlu/w6rYsmaE1OQB0QVtW3N/pLvfwLghD9Mgjbls37m9m1gPBhZum0oTeMIFHk3ldyUKFizM17smanI9rjueJqsYwO5rDy3vQngYPm6DLuT4nLm9UMGKGmtp2ENc4WsTiJkQ6ktPHNGBnNltaODzh7rKzCqDR+DmfTmH2q9giN4JKHu6IgDOVm3I5UwTqVQFR+YstDW9bO91ERiyPQ1e+hHqcMDpw92Hf91XQdUJqCq3pLaPORPMNukj0baTndYQsLy9Vrb45Ihf9rgi971+kDDY9p07A4S1HmM+uVNJVZksKvP2Nx1ewpubPGrE+7rO5VzqIUPkvaHvGH9sQrQmiOkLg3HdMNEvdDZ7Qr9o5Czl4mZ7jA3MB8wBwYFKw4DAhoEFAK36LaYXc7YcYg6XD2a3LQn+JIwBBShse4lclEEl8cf0c74e7/7loMKjA==\",\"contentType\":\"application/x-pkcs12\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeCertificate/8cdf2990db2d47588122682e8b361bf9\",\"managed\":true,\"attributes\":{\"enabled\":true,\"nbf\":1471039082,\"exp\":1534111682,\"created\":1471039682,\"updated\":1471039683},\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeCertificate/8cdf2990db2d47588122682e8b361bf9\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '6696ecba-8638-42b9-aee1-eabf7e1c5925', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:04 GMT', + connection: 'close', + 'content-length': '3890' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .delete('/certificates/nodeCertificate?api-version=2015-06-01') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/nodeCertificate/8cdf2990db2d47588122682e8b361bf9\",\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeCertificate/8cdf2990db2d47588122682e8b361bf9\",\"sid\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeCertificate/8cdf2990db2d47588122682e8b361bf9\",\"x5t\":\"J_Ubi2k5Rgn9GdjN1kBZC1DoDtE\",\"cer\":\"MIIDOjCCAiKgAwIBAgIQPQm9uZ4kQDGFpRDui5GW3zANBgkqhkiG9w0BAQsFADAaMRgwFgYDVQQDDA8qLm1pY3Jvc29mdC5jb20wHhcNMTYwODEyMjE1ODAyWhcNMTgwODEyMjIwODAyWjAaMRgwFgYDVQQDDA8qLm1pY3Jvc29mdC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCsJzQ+q9wv8FUEsUhN3xC33mmhLIQMTrF6mft6lSmHyPn+ypw9y8751w4+2QggjmwXWNtOmiVGsBiF6sTo9oxiWyYd/OqZ8RUm6eYaRs2LVFwYFmXhEy71AZgwlGfPlBpvmf8kBEs0ur7Fza3O7Eo4Wr+iMeA01hS8vBJKSRA3ejiIaDuISeyqU5ixHjc1zR5+WDh/3c95p7ir59Ey5nhBTrsnwYLbNatkG3VntBh8eVr/98nIgRbuMh98pLE6uJXeHLoLwbaSEusQPmJI7b8aCpcHCuQyq9vV9e7cMI++OT5iE3Wc8xN0GQ774kvqVABSpJ63BUS5GCqqHzzNWyM1AgMBAAGjfDB6MA4GA1UdDwEB/wQEAwIFoDAJBgNVHRMEAjAAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAfBgNVHSMEGDAWgBQ9hJaRvMrPNHYEedFXB0sKwgeagDAdBgNVHQ4EFgQUPYSWkbzKzzR2BHnRVwdLCsIHmoAwDQYJKoZIhvcNAQELBQADggEBAAk07TEyJySY2mzWVBVW47w2y0YARn/94JbR3EVg/dSoc/dRUDZ2uzPhr1uPmxgHeY8VoNSjpDsBEMytFBMGC8BcLroJh+6ysI7ZnEfheYrrOc3J/Ld+JRD9bQXcCdWPRp95pdGWYAWXB73duE5/hH3c1XqN8I1izC6dn230TWP/76cUwfVsqOtrQNzNnrMX4akWQ3PsMapuW8Iz4Xv8fo9EqdEbsf5VHLVPumEateivcln0Reeinf1/3QZpgQEe6VSHx2TKsWMeWjpivNMp2MY0JuVM+mGloEzksKWLIPynN7t0WuoTWcJnz0fFMqvDIsSfGUS2n6m1afTGyQc3MZM=\",\"attributes\":{\"enabled\":true,\"nbf\":1471039082,\"exp\":1534111682,\"created\":1471039682,\"updated\":1471039683},\"tags\":{\"tag1\":\"value1\"},\"policy\":{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/nodeCertificate/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=*.microsoft.com\",\"sans\":{},\"ekus\":[\"1.3.6.1.5.5.7.3.1\",\"1.3.6.1.5.5.7.3.2\"],\"key_usage\":[\"digitalSignature\",\"keyEncipherment\"],\"validity_months\":24,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"AutoRenew\"}}],\"issuer\":{\"name\":\"Self\"},\"attributes\":{\"enabled\":true,\"created\":1471039676,\"updated\":1471039676}},\"pending\":{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/nodeCertificate/pending\"}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'ea53f01d-224e-4a04-8f84-61ffbfe4454a', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:05 GMT', + connection: 'close', + 'content-length': '2332' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .delete('/certificates/nodeCertificate?api-version=2015-06-01') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/nodeCertificate/8cdf2990db2d47588122682e8b361bf9\",\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeCertificate/8cdf2990db2d47588122682e8b361bf9\",\"sid\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeCertificate/8cdf2990db2d47588122682e8b361bf9\",\"x5t\":\"J_Ubi2k5Rgn9GdjN1kBZC1DoDtE\",\"cer\":\"MIIDOjCCAiKgAwIBAgIQPQm9uZ4kQDGFpRDui5GW3zANBgkqhkiG9w0BAQsFADAaMRgwFgYDVQQDDA8qLm1pY3Jvc29mdC5jb20wHhcNMTYwODEyMjE1ODAyWhcNMTgwODEyMjIwODAyWjAaMRgwFgYDVQQDDA8qLm1pY3Jvc29mdC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCsJzQ+q9wv8FUEsUhN3xC33mmhLIQMTrF6mft6lSmHyPn+ypw9y8751w4+2QggjmwXWNtOmiVGsBiF6sTo9oxiWyYd/OqZ8RUm6eYaRs2LVFwYFmXhEy71AZgwlGfPlBpvmf8kBEs0ur7Fza3O7Eo4Wr+iMeA01hS8vBJKSRA3ejiIaDuISeyqU5ixHjc1zR5+WDh/3c95p7ir59Ey5nhBTrsnwYLbNatkG3VntBh8eVr/98nIgRbuMh98pLE6uJXeHLoLwbaSEusQPmJI7b8aCpcHCuQyq9vV9e7cMI++OT5iE3Wc8xN0GQ774kvqVABSpJ63BUS5GCqqHzzNWyM1AgMBAAGjfDB6MA4GA1UdDwEB/wQEAwIFoDAJBgNVHRMEAjAAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAfBgNVHSMEGDAWgBQ9hJaRvMrPNHYEedFXB0sKwgeagDAdBgNVHQ4EFgQUPYSWkbzKzzR2BHnRVwdLCsIHmoAwDQYJKoZIhvcNAQELBQADggEBAAk07TEyJySY2mzWVBVW47w2y0YARn/94JbR3EVg/dSoc/dRUDZ2uzPhr1uPmxgHeY8VoNSjpDsBEMytFBMGC8BcLroJh+6ysI7ZnEfheYrrOc3J/Ld+JRD9bQXcCdWPRp95pdGWYAWXB73duE5/hH3c1XqN8I1izC6dn230TWP/76cUwfVsqOtrQNzNnrMX4akWQ3PsMapuW8Iz4Xv8fo9EqdEbsf5VHLVPumEateivcln0Reeinf1/3QZpgQEe6VSHx2TKsWMeWjpivNMp2MY0JuVM+mGloEzksKWLIPynN7t0WuoTWcJnz0fFMqvDIsSfGUS2n6m1afTGyQc3MZM=\",\"attributes\":{\"enabled\":true,\"nbf\":1471039082,\"exp\":1534111682,\"created\":1471039682,\"updated\":1471039683},\"tags\":{\"tag1\":\"value1\"},\"policy\":{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/nodeCertificate/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=*.microsoft.com\",\"sans\":{},\"ekus\":[\"1.3.6.1.5.5.7.3.1\",\"1.3.6.1.5.5.7.3.2\"],\"key_usage\":[\"digitalSignature\",\"keyEncipherment\"],\"validity_months\":24,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"AutoRenew\"}}],\"issuer\":{\"name\":\"Self\"},\"attributes\":{\"enabled\":true,\"created\":1471039676,\"updated\":1471039676}},\"pending\":{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/nodeCertificate/pending\"}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'ea53f01d-224e-4a04-8f84-61ffbfe4454a', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:05 GMT', + connection: 'close', + 'content-length': '2332' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates/nodeCertificate/?api-version=2015-06-01') + .reply(404, "{\"error\":{\"code\":\"CertificateNotFound\",\"message\":\"Certificate nodeCertificate not found\"}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-length': '90', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '5627f38d-f8af-4937-9694-96c525eb4de4', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:05 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates/nodeCertificate/?api-version=2015-06-01') + .reply(404, "{\"error\":{\"code\":\"CertificateNotFound\",\"message\":\"Certificate nodeCertificate not found\"}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-length': '90', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '5627f38d-f8af-4937-9694-96c525eb4de4', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:05 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.post('/certificates/nodeImportCertificate/import?api-version=2015-06-01', '*') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/nodeImportCertificate/8b79d34882d1440bab17bf4b719fa5c7\",\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeImportCertificate/8b79d34882d1440bab17bf4b719fa5c7\",\"sid\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeImportCertificate/8b79d34882d1440bab17bf4b719fa5c7\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"cer\":\"MIICODCCAeagAwIBAgIQqHmpBAv+CY9IJFoUhlbziTAJBgUrDgMCHQUAMBYxFDASBgNVBAMTC1Jvb3QgQWdlbmN5MB4XDTE1MDQyOTIxNTM0MVoXDTM5MTIzMTIzNTk1OVowFzEVMBMGA1UEAxMMS2V5VmF1bHRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bVAT73zr4+N4WVv2+SvTunAw08ksS4BrJW/nNliz3S9XuzMBMXvmYzU5HJ8TtEgluBiZZYd5qsMJD+OXHSNbsLdmMhni0jYX09h3XlC2VJw2sGKeYF+xEaavXm337aZZaZyjrFBrrUl51UePaN+kVFXNlBb3N3TYpqa7KokXenJQuR+i9Gv9a77c0UsSsDSryxppYhKK7HvTZCpKrhVtulF5iPMswWe9np3uggfMamyIsK/0L7X9w9B2qN7993RR0A00nOk4H6CnkuwO77dSsD0KJsk6FyAoZBzRXDZh9+d9R76zCL506NcQy/jl0lCiQYwsUX73PG5pxOh02OwKwIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAGqIjo2geVagzuzaZOe1ClGKhZeiCKfWAxklaGN+qlGUbVS4IN4V1lot3VKnzabasmkEHeNxPwLn1qvSD0cX9CE=\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471039687,\"updated\":1471039687},\"policy\":{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/nodeImportCertificate/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1469572871,\"updated\":1471039687}}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'c91ecf92-8f25-4ec6-8e60-45917273bd60', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:08 GMT', + connection: 'close', + 'content-length': '1810' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.post('/certificates/nodeImportCertificate/import?api-version=2015-06-01', '*') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/nodeImportCertificate/8b79d34882d1440bab17bf4b719fa5c7\",\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeImportCertificate/8b79d34882d1440bab17bf4b719fa5c7\",\"sid\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeImportCertificate/8b79d34882d1440bab17bf4b719fa5c7\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"cer\":\"MIICODCCAeagAwIBAgIQqHmpBAv+CY9IJFoUhlbziTAJBgUrDgMCHQUAMBYxFDASBgNVBAMTC1Jvb3QgQWdlbmN5MB4XDTE1MDQyOTIxNTM0MVoXDTM5MTIzMTIzNTk1OVowFzEVMBMGA1UEAxMMS2V5VmF1bHRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bVAT73zr4+N4WVv2+SvTunAw08ksS4BrJW/nNliz3S9XuzMBMXvmYzU5HJ8TtEgluBiZZYd5qsMJD+OXHSNbsLdmMhni0jYX09h3XlC2VJw2sGKeYF+xEaavXm337aZZaZyjrFBrrUl51UePaN+kVFXNlBb3N3TYpqa7KokXenJQuR+i9Gv9a77c0UsSsDSryxppYhKK7HvTZCpKrhVtulF5iPMswWe9np3uggfMamyIsK/0L7X9w9B2qN7993RR0A00nOk4H6CnkuwO77dSsD0KJsk6FyAoZBzRXDZh9+d9R76zCL506NcQy/jl0lCiQYwsUX73PG5pxOh02OwKwIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAGqIjo2geVagzuzaZOe1ClGKhZeiCKfWAxklaGN+qlGUbVS4IN4V1lot3VKnzabasmkEHeNxPwLn1qvSD0cX9CE=\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471039687,\"updated\":1471039687},\"policy\":{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/nodeImportCertificate/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1469572871,\"updated\":1471039687}}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'c91ecf92-8f25-4ec6-8e60-45917273bd60', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:08 GMT', + connection: 'close', + 'content-length': '1810' }); + return result; }], +[function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.post('/certificates/importListCertificate1/import?api-version=2015-06-01', '*') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListCertificate1/38092a271a504561ade1e9adb19abee3\",\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/importListCertificate1/38092a271a504561ade1e9adb19abee3\",\"sid\":\"https://sdktestvault0511.vault.azure.net/secrets/importListCertificate1/38092a271a504561ade1e9adb19abee3\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"cer\":\"MIICODCCAeagAwIBAgIQqHmpBAv+CY9IJFoUhlbziTAJBgUrDgMCHQUAMBYxFDASBgNVBAMTC1Jvb3QgQWdlbmN5MB4XDTE1MDQyOTIxNTM0MVoXDTM5MTIzMTIzNTk1OVowFzEVMBMGA1UEAxMMS2V5VmF1bHRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bVAT73zr4+N4WVv2+SvTunAw08ksS4BrJW/nNliz3S9XuzMBMXvmYzU5HJ8TtEgluBiZZYd5qsMJD+OXHSNbsLdmMhni0jYX09h3XlC2VJw2sGKeYF+xEaavXm337aZZaZyjrFBrrUl51UePaN+kVFXNlBb3N3TYpqa7KokXenJQuR+i9Gv9a77c0UsSsDSryxppYhKK7HvTZCpKrhVtulF5iPMswWe9np3uggfMamyIsK/0L7X9w9B2qN7993RR0A00nOk4H6CnkuwO77dSsD0KJsk6FyAoZBzRXDZh9+d9R76zCL506NcQy/jl0lCiQYwsUX73PG5pxOh02OwKwIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAGqIjo2geVagzuzaZOe1ClGKhZeiCKfWAxklaGN+qlGUbVS4IN4V1lot3VKnzabasmkEHeNxPwLn1qvSD0cX9CE=\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471039688,\"updated\":1471039688},\"policy\":{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListCertificate1/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1469572872,\"updated\":1471039688}}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '18870533-6f76-41a1-9130-0674f965839d', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:09 GMT', + connection: 'close', + 'content-length': '1814' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.post('/certificates/importListCertificate1/import?api-version=2015-06-01', '*') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListCertificate1/38092a271a504561ade1e9adb19abee3\",\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/importListCertificate1/38092a271a504561ade1e9adb19abee3\",\"sid\":\"https://sdktestvault0511.vault.azure.net/secrets/importListCertificate1/38092a271a504561ade1e9adb19abee3\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"cer\":\"MIICODCCAeagAwIBAgIQqHmpBAv+CY9IJFoUhlbziTAJBgUrDgMCHQUAMBYxFDASBgNVBAMTC1Jvb3QgQWdlbmN5MB4XDTE1MDQyOTIxNTM0MVoXDTM5MTIzMTIzNTk1OVowFzEVMBMGA1UEAxMMS2V5VmF1bHRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bVAT73zr4+N4WVv2+SvTunAw08ksS4BrJW/nNliz3S9XuzMBMXvmYzU5HJ8TtEgluBiZZYd5qsMJD+OXHSNbsLdmMhni0jYX09h3XlC2VJw2sGKeYF+xEaavXm337aZZaZyjrFBrrUl51UePaN+kVFXNlBb3N3TYpqa7KokXenJQuR+i9Gv9a77c0UsSsDSryxppYhKK7HvTZCpKrhVtulF5iPMswWe9np3uggfMamyIsK/0L7X9w9B2qN7993RR0A00nOk4H6CnkuwO77dSsD0KJsk6FyAoZBzRXDZh9+d9R76zCL506NcQy/jl0lCiQYwsUX73PG5pxOh02OwKwIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAGqIjo2geVagzuzaZOe1ClGKhZeiCKfWAxklaGN+qlGUbVS4IN4V1lot3VKnzabasmkEHeNxPwLn1qvSD0cX9CE=\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471039688,\"updated\":1471039688},\"policy\":{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListCertificate1/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1469572872,\"updated\":1471039688}}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '18870533-6f76-41a1-9130-0674f965839d', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:09 GMT', + connection: 'close', + 'content-length': '1814' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.post('/certificates/importListCertificate2/import?api-version=2015-06-01', '*') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListCertificate2/1b20bb96f079453d8d63c573bf43cdb6\",\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/importListCertificate2/1b20bb96f079453d8d63c573bf43cdb6\",\"sid\":\"https://sdktestvault0511.vault.azure.net/secrets/importListCertificate2/1b20bb96f079453d8d63c573bf43cdb6\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"cer\":\"MIICODCCAeagAwIBAgIQqHmpBAv+CY9IJFoUhlbziTAJBgUrDgMCHQUAMBYxFDASBgNVBAMTC1Jvb3QgQWdlbmN5MB4XDTE1MDQyOTIxNTM0MVoXDTM5MTIzMTIzNTk1OVowFzEVMBMGA1UEAxMMS2V5VmF1bHRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bVAT73zr4+N4WVv2+SvTunAw08ksS4BrJW/nNliz3S9XuzMBMXvmYzU5HJ8TtEgluBiZZYd5qsMJD+OXHSNbsLdmMhni0jYX09h3XlC2VJw2sGKeYF+xEaavXm337aZZaZyjrFBrrUl51UePaN+kVFXNlBb3N3TYpqa7KokXenJQuR+i9Gv9a77c0UsSsDSryxppYhKK7HvTZCpKrhVtulF5iPMswWe9np3uggfMamyIsK/0L7X9w9B2qN7993RR0A00nOk4H6CnkuwO77dSsD0KJsk6FyAoZBzRXDZh9+d9R76zCL506NcQy/jl0lCiQYwsUX73PG5pxOh02OwKwIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAGqIjo2geVagzuzaZOe1ClGKhZeiCKfWAxklaGN+qlGUbVS4IN4V1lot3VKnzabasmkEHeNxPwLn1qvSD0cX9CE=\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471039690,\"updated\":1471039690},\"policy\":{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListCertificate2/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1469572873,\"updated\":1471039690}}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'd600857e-802f-4e2c-acfe-90a5b1540d6f', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:10 GMT', + connection: 'close', + 'content-length': '1814' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.post('/certificates/importListCertificate2/import?api-version=2015-06-01', '*') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListCertificate2/1b20bb96f079453d8d63c573bf43cdb6\",\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/importListCertificate2/1b20bb96f079453d8d63c573bf43cdb6\",\"sid\":\"https://sdktestvault0511.vault.azure.net/secrets/importListCertificate2/1b20bb96f079453d8d63c573bf43cdb6\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"cer\":\"MIICODCCAeagAwIBAgIQqHmpBAv+CY9IJFoUhlbziTAJBgUrDgMCHQUAMBYxFDASBgNVBAMTC1Jvb3QgQWdlbmN5MB4XDTE1MDQyOTIxNTM0MVoXDTM5MTIzMTIzNTk1OVowFzEVMBMGA1UEAxMMS2V5VmF1bHRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bVAT73zr4+N4WVv2+SvTunAw08ksS4BrJW/nNliz3S9XuzMBMXvmYzU5HJ8TtEgluBiZZYd5qsMJD+OXHSNbsLdmMhni0jYX09h3XlC2VJw2sGKeYF+xEaavXm337aZZaZyjrFBrrUl51UePaN+kVFXNlBb3N3TYpqa7KokXenJQuR+i9Gv9a77c0UsSsDSryxppYhKK7HvTZCpKrhVtulF5iPMswWe9np3uggfMamyIsK/0L7X9w9B2qN7993RR0A00nOk4H6CnkuwO77dSsD0KJsk6FyAoZBzRXDZh9+d9R76zCL506NcQy/jl0lCiQYwsUX73PG5pxOh02OwKwIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAGqIjo2geVagzuzaZOe1ClGKhZeiCKfWAxklaGN+qlGUbVS4IN4V1lot3VKnzabasmkEHeNxPwLn1qvSD0cX9CE=\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471039690,\"updated\":1471039690},\"policy\":{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListCertificate2/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1469572873,\"updated\":1471039690}}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'd600857e-802f-4e2c-acfe-90a5b1540d6f', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:10 GMT', + connection: 'close', + 'content-length': '1814' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates?maxresults=2&api-version=2015-06-01') + .reply(200, "{\"value\":[],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMTIhTURBd01ETTVJV05sY25ScFptbGpZWFJsTDBOU1JVRlVSVTFCVGxWQlRFVk9VazlNVEUxRlRsUktRVlpCTnlFd01EQXdNamdoT1RrNU9TMHhNaTB6TVZReU16bzFPVG8xT1M0NU9UazVPVGs1V2lFLSIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '96059cd1-652a-4cd9-951f-fcdac4e1fe93', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:11 GMT', + connection: 'close', + 'content-length': '337' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates?maxresults=2&api-version=2015-06-01') + .reply(200, "{\"value\":[],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMTIhTURBd01ETTVJV05sY25ScFptbGpZWFJsTDBOU1JVRlVSVTFCVGxWQlRFVk9VazlNVEUxRlRsUktRVlpCTnlFd01EQXdNamdoT1RrNU9TMHhNaTB6TVZReU16bzFPVG8xT1M0NU9UazVPVGs1V2lFLSIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '96059cd1-652a-4cd9-951f-fcdac4e1fe93', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:11 GMT', + connection: 'close', + 'content-length': '337' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMTIhTURBd01ETTVJV05sY25ScFptbGpZWFJsTDBOU1JVRlVSVTFCVGxWQlRFVk9VazlNVEUxRlRsUktRVlpCTnlFd01EQXdNamdoT1RrNU9TMHhNaTB6TVZReU16bzFPVG8xT1M0NU9UazVPVGs1V2lFLSIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMTIhTURBd01ETTVJV05sY25ScFptbGpZWFJsTDBOU1JVRlVSVTFCVGxWQlRFVk9VazlNVEUxRlRsUktRVlpCT1NFd01EQXdNamdoT1RrNU9TMHhNaTB6TVZReU16bzFPVG8xT1M0NU9UazVPVGs1V2lFLSIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'f9f695c9-a8f7-4ec1-9b89-3da5b3dd4c54', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:11 GMT', + connection: 'close', + 'content-length': '337' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMTIhTURBd01ETTVJV05sY25ScFptbGpZWFJsTDBOU1JVRlVSVTFCVGxWQlRFVk9VazlNVEUxRlRsUktRVlpCTnlFd01EQXdNamdoT1RrNU9TMHhNaTB6TVZReU16bzFPVG8xT1M0NU9UazVPVGs1V2lFLSIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMTIhTURBd01ETTVJV05sY25ScFptbGpZWFJsTDBOU1JVRlVSVTFCVGxWQlRFVk9VazlNVEUxRlRsUktRVlpCT1NFd01EQXdNamdoT1RrNU9TMHhNaTB6TVZReU16bzFPVG8xT1M0NU9UazVPVGs1V2lFLSIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'f9f695c9-a8f7-4ec1-9b89-3da5b3dd4c54', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:11 GMT', + connection: 'close', + 'content-length': '337' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMTIhTURBd01ETTVJV05sY25ScFptbGpZWFJsTDBOU1JVRlVSVTFCVGxWQlRFVk9VazlNVEUxRlRsUktRVlpCT1NFd01EQXdNamdoT1RrNU9TMHhNaTB6TVZReU16bzFPVG8xT1M0NU9UazVPVGs1V2lFLSIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListCertificate1\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471039688,\"updated\":1471039688}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDQhTURBd01ETTBJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSRFJWSlVTVVpKUTBGVVJUSWhNREF3TURJNElUSXdNVFl0TURjdE1qWlVNakk2TkRnNk1UZ3VNVGN4TWpRNU5Gb2giLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '6c28a639-d22c-41c8-973d-29a2ce6055c7', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:11 GMT', + connection: 'close', + 'content-length': '553' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMTIhTURBd01ETTVJV05sY25ScFptbGpZWFJsTDBOU1JVRlVSVTFCVGxWQlRFVk9VazlNVEUxRlRsUktRVlpCT1NFd01EQXdNamdoT1RrNU9TMHhNaTB6TVZReU16bzFPVG8xT1M0NU9UazVPVGs1V2lFLSIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListCertificate1\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471039688,\"updated\":1471039688}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDQhTURBd01ETTBJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSRFJWSlVTVVpKUTBGVVJUSWhNREF3TURJNElUSXdNVFl0TURjdE1qWlVNakk2TkRnNk1UZ3VNVGN4TWpRNU5Gb2giLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '6c28a639-d22c-41c8-973d-29a2ce6055c7', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:11 GMT', + connection: 'close', + 'content-length': '553' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDQhTURBd01ETTBJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSRFJWSlVTVVpKUTBGVVJUSWhNREF3TURJNElUSXdNVFl0TURjdE1qWlVNakk2TkRnNk1UZ3VNVGN4TWpRNU5Gb2giLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListCertificate2\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471039690,\"updated\":1471039690}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471039162,\"updated\":1471039162}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMjghTURBd01EVXlJV05sY25ScFptbGpZWFJsTDBsVFUxVkZVbE12UTFKRlFWUkZRMFZTVkVsR1NVTkJWRVZLUVZaQlVFVk5TVk5UVlVWU01ERWhNREF3TURJNElUSXdNVFl0TURjdE1UaFVNakk2TURNNk1qa3VNalEwTXprek1sb2giLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '2695a688-fbdf-48a8-b730-2a0abeee4c66', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:13 GMT', + connection: 'close', + 'content-length': '813' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDQhTURBd01ETTBJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSRFJWSlVTVVpKUTBGVVJUSWhNREF3TURJNElUSXdNVFl0TURjdE1qWlVNakk2TkRnNk1UZ3VNVGN4TWpRNU5Gb2giLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListCertificate2\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471039690,\"updated\":1471039690}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471039162,\"updated\":1471039162}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMjghTURBd01EVXlJV05sY25ScFptbGpZWFJsTDBsVFUxVkZVbE12UTFKRlFWUkZRMFZTVkVsR1NVTkJWRVZLUVZaQlVFVk5TVk5UVlVWU01ERWhNREF3TURJNElUSXdNVFl0TURjdE1UaFVNakk2TURNNk1qa3VNalEwTXprek1sb2giLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '2695a688-fbdf-48a8-b730-2a0abeee4c66', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:13 GMT', + connection: 'close', + 'content-length': '813' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMjghTURBd01EVXlJV05sY25ScFptbGpZWFJsTDBsVFUxVkZVbE12UTFKRlFWUkZRMFZTVkVsR1NVTkJWRVZLUVZaQlVFVk5TVk5UVlVWU01ERWhNREF3TURJNElUSXdNVFl0TURjdE1UaFVNakk2TURNNk1qa3VNalEwTXprek1sb2giLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/listCertificate0\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470774077,\"updated\":1470774077}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/listCertificate1\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470774079,\"updated\":1470774079}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDghTURBd01ETTFJV05sY25ScFptbGpZWFJsTDB4SlUxUkRSVkpVU1VaSlEwRlVSVEV2VUU5TVNVTlpJVEF3TURBeU9DRXlNREUyTFRBM0xUSTJWREl3T2pJeU9qTTJMakkyTlRVMk16TmFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'd7354b75-798a-406f-9444-fb984c76b032', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:13 GMT', + connection: 'close', + 'content-length': '774' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMjghTURBd01EVXlJV05sY25ScFptbGpZWFJsTDBsVFUxVkZVbE12UTFKRlFWUkZRMFZTVkVsR1NVTkJWRVZLUVZaQlVFVk5TVk5UVlVWU01ERWhNREF3TURJNElUSXdNVFl0TURjdE1UaFVNakk2TURNNk1qa3VNalEwTXprek1sb2giLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/listCertificate0\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470774077,\"updated\":1470774077}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/listCertificate1\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470774079,\"updated\":1470774079}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDghTURBd01ETTFJV05sY25ScFptbGpZWFJsTDB4SlUxUkRSVkpVU1VaSlEwRlVSVEV2VUU5TVNVTlpJVEF3TURBeU9DRXlNREUyTFRBM0xUSTJWREl3T2pJeU9qTTJMakkyTlRVMk16TmFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'd7354b75-798a-406f-9444-fb984c76b032', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:13 GMT', + connection: 'close', + 'content-length': '774' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDghTURBd01ETTFJV05sY25ScFptbGpZWFJsTDB4SlUxUkRSVkpVU1VaSlEwRlVSVEV2VUU5TVNVTlpJVEF3TURBeU9DRXlNREUyTFRBM0xUSTJWREl3T2pJeU9qTTJMakkyTlRVMk16TmFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/listCertificate2\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470774080,\"updated\":1470774080}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/listCertificate3\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470774081,\"updated\":1470774081}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDghTURBd01ETTFJV05sY25ScFptbGpZWFJsTDB4SlUxUkRSVkpVU1VaSlEwRlVSVE12VUU5TVNVTlpJVEF3TURBeU9DRXlNREUyTFRBM0xUSTJWREl3T2pJeU9qTTVMakU0TlRjeU56WmFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '3cd7b908-9408-4ed0-91f9-1b931a3f62be', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:12 GMT', + connection: 'close', + 'content-length': '774' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDghTURBd01ETTFJV05sY25ScFptbGpZWFJsTDB4SlUxUkRSVkpVU1VaSlEwRlVSVEV2VUU5TVNVTlpJVEF3TURBeU9DRXlNREUyTFRBM0xUSTJWREl3T2pJeU9qTTJMakkyTlRVMk16TmFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/listCertificate2\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470774080,\"updated\":1470774080}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/listCertificate3\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470774081,\"updated\":1470774081}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDghTURBd01ETTFJV05sY25ScFptbGpZWFJsTDB4SlUxUkRSVkpVU1VaSlEwRlVSVE12VUU5TVNVTlpJVEF3TURBeU9DRXlNREUyTFRBM0xUSTJWREl3T2pJeU9qTTVMakU0TlRjeU56WmFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '3cd7b908-9408-4ed0-91f9-1b931a3f62be', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:12 GMT', + connection: 'close', + 'content-length': '774' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDghTURBd01ETTFJV05sY25ScFptbGpZWFJsTDB4SlUxUkRSVkpVU1VaSlEwRlVSVE12VUU5TVNVTlpJVEF3TURBeU9DRXlNREUyTFRBM0xUSTJWREl3T2pJeU9qTTVMakU0TlRjeU56WmFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/nodeImportCertificate\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471039687,\"updated\":1471039687}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/policyCertificate\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471039195,\"updated\":1471039195}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDghTURBd01ETTJJV05sY25ScFptbGpZWFJsTDFCUFRFbERXVU5GVWxSSlJrbERRVlJGTDFCUFRFbERXU0V3TURBd01qZ2hNakF4Tmkwd055MHlObFF5TWpvME1Ub3pNQzQxTnpNeU56YzBXaUUtIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '69f80f49-9d8c-461c-b40a-07c1a9be807f', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:14 GMT', + connection: 'close', + 'content-length': '780' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDghTURBd01ETTFJV05sY25ScFptbGpZWFJsTDB4SlUxUkRSVkpVU1VaSlEwRlVSVE12VUU5TVNVTlpJVEF3TURBeU9DRXlNREUyTFRBM0xUSTJWREl3T2pJeU9qTTVMakU0TlRjeU56WmFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/nodeImportCertificate\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471039687,\"updated\":1471039687}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/policyCertificate\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471039195,\"updated\":1471039195}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDghTURBd01ETTJJV05sY25ScFptbGpZWFJsTDFCUFRFbERXVU5GVWxSSlJrbERRVlJGTDFCUFRFbERXU0V3TURBd01qZ2hNakF4Tmkwd055MHlObFF5TWpvME1Ub3pNQzQxTnpNeU56YzBXaUUtIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '69f80f49-9d8c-461c-b40a-07c1a9be807f', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:14 GMT', + connection: 'close', + 'content-length': '780' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDghTURBd01ETTJJV05sY25ScFptbGpZWFJsTDFCUFRFbERXVU5GVWxSSlJrbERRVlJGTDFCUFRFbERXU0V3TURBd01qZ2hNakF4Tmkwd055MHlObFF5TWpvME1Ub3pNQzQxTnpNeU56YzBXaUUtIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2') + .reply(200, "{\"value\":[],\"nextLink\":null}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '0daf182a-aedf-4f74-aaeb-dfac529c11ae', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:15 GMT', + connection: 'close', + 'content-length': '28' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDghTURBd01ETTJJV05sY25ScFptbGpZWFJsTDFCUFRFbERXVU5GVWxSSlJrbERRVlJGTDFCUFRFbERXU0V3TURBd01qZ2hNakF4Tmkwd055MHlObFF5TWpvME1Ub3pNQzQxTnpNeU56YzBXaUUtIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2') + .reply(200, "{\"value\":[],\"nextLink\":null}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '0daf182a-aedf-4f74-aaeb-dfac529c11ae', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:15 GMT', + connection: 'close', + 'content-length': '28' }); + return result; }], +[function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.post('/certificates/importListVersionCerts/import?api-version=2015-06-01', '*') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/0a7b67f6343f47918445e0b501f27cf1\",\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/importListVersionCerts/0a7b67f6343f47918445e0b501f27cf1\",\"sid\":\"https://sdktestvault0511.vault.azure.net/secrets/importListVersionCerts/0a7b67f6343f47918445e0b501f27cf1\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"cer\":\"MIICODCCAeagAwIBAgIQqHmpBAv+CY9IJFoUhlbziTAJBgUrDgMCHQUAMBYxFDASBgNVBAMTC1Jvb3QgQWdlbmN5MB4XDTE1MDQyOTIxNTM0MVoXDTM5MTIzMTIzNTk1OVowFzEVMBMGA1UEAxMMS2V5VmF1bHRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bVAT73zr4+N4WVv2+SvTunAw08ksS4BrJW/nNliz3S9XuzMBMXvmYzU5HJ8TtEgluBiZZYd5qsMJD+OXHSNbsLdmMhni0jYX09h3XlC2VJw2sGKeYF+xEaavXm337aZZaZyjrFBrrUl51UePaN+kVFXNlBb3N3TYpqa7KokXenJQuR+i9Gv9a77c0UsSsDSryxppYhKK7HvTZCpKrhVtulF5iPMswWe9np3uggfMamyIsK/0L7X9w9B2qN7993RR0A00nOk4H6CnkuwO77dSsD0KJsk6FyAoZBzRXDZh9+d9R76zCL506NcQy/jl0lCiQYwsUX73PG5pxOh02OwKwIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAGqIjo2geVagzuzaZOe1ClGKhZeiCKfWAxklaGN+qlGUbVS4IN4V1lot3VKnzabasmkEHeNxPwLn1qvSD0cX9CE=\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471039695,\"updated\":1471039695},\"policy\":{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1469572877,\"updated\":1471039695}}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'f6420096-e315-401d-aa98-196fee7f349d', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:15 GMT', + connection: 'close', + 'content-length': '1814' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.post('/certificates/importListVersionCerts/import?api-version=2015-06-01', '*') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/0a7b67f6343f47918445e0b501f27cf1\",\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/importListVersionCerts/0a7b67f6343f47918445e0b501f27cf1\",\"sid\":\"https://sdktestvault0511.vault.azure.net/secrets/importListVersionCerts/0a7b67f6343f47918445e0b501f27cf1\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"cer\":\"MIICODCCAeagAwIBAgIQqHmpBAv+CY9IJFoUhlbziTAJBgUrDgMCHQUAMBYxFDASBgNVBAMTC1Jvb3QgQWdlbmN5MB4XDTE1MDQyOTIxNTM0MVoXDTM5MTIzMTIzNTk1OVowFzEVMBMGA1UEAxMMS2V5VmF1bHRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bVAT73zr4+N4WVv2+SvTunAw08ksS4BrJW/nNliz3S9XuzMBMXvmYzU5HJ8TtEgluBiZZYd5qsMJD+OXHSNbsLdmMhni0jYX09h3XlC2VJw2sGKeYF+xEaavXm337aZZaZyjrFBrrUl51UePaN+kVFXNlBb3N3TYpqa7KokXenJQuR+i9Gv9a77c0UsSsDSryxppYhKK7HvTZCpKrhVtulF5iPMswWe9np3uggfMamyIsK/0L7X9w9B2qN7993RR0A00nOk4H6CnkuwO77dSsD0KJsk6FyAoZBzRXDZh9+d9R76zCL506NcQy/jl0lCiQYwsUX73PG5pxOh02OwKwIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAGqIjo2geVagzuzaZOe1ClGKhZeiCKfWAxklaGN+qlGUbVS4IN4V1lot3VKnzabasmkEHeNxPwLn1qvSD0cX9CE=\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471039695,\"updated\":1471039695},\"policy\":{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1469572877,\"updated\":1471039695}}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'f6420096-e315-401d-aa98-196fee7f349d', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:15 GMT', + connection: 'close', + 'content-length': '1814' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.post('/certificates/importListVersionCerts/import?api-version=2015-06-01', '*') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/106ecc1c65d54ccdbd7afaf599a0a691\",\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/importListVersionCerts/106ecc1c65d54ccdbd7afaf599a0a691\",\"sid\":\"https://sdktestvault0511.vault.azure.net/secrets/importListVersionCerts/106ecc1c65d54ccdbd7afaf599a0a691\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"cer\":\"MIICODCCAeagAwIBAgIQqHmpBAv+CY9IJFoUhlbziTAJBgUrDgMCHQUAMBYxFDASBgNVBAMTC1Jvb3QgQWdlbmN5MB4XDTE1MDQyOTIxNTM0MVoXDTM5MTIzMTIzNTk1OVowFzEVMBMGA1UEAxMMS2V5VmF1bHRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bVAT73zr4+N4WVv2+SvTunAw08ksS4BrJW/nNliz3S9XuzMBMXvmYzU5HJ8TtEgluBiZZYd5qsMJD+OXHSNbsLdmMhni0jYX09h3XlC2VJw2sGKeYF+xEaavXm337aZZaZyjrFBrrUl51UePaN+kVFXNlBb3N3TYpqa7KokXenJQuR+i9Gv9a77c0UsSsDSryxppYhKK7HvTZCpKrhVtulF5iPMswWe9np3uggfMamyIsK/0L7X9w9B2qN7993RR0A00nOk4H6CnkuwO77dSsD0KJsk6FyAoZBzRXDZh9+d9R76zCL506NcQy/jl0lCiQYwsUX73PG5pxOh02OwKwIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAGqIjo2geVagzuzaZOe1ClGKhZeiCKfWAxklaGN+qlGUbVS4IN4V1lot3VKnzabasmkEHeNxPwLn1qvSD0cX9CE=\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471039697,\"updated\":1471039697},\"policy\":{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1469572877,\"updated\":1471039697}}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '2d113756-13b7-4b53-997d-c65b43fbd8e7', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:17 GMT', + connection: 'close', + 'content-length': '1814' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.post('/certificates/importListVersionCerts/import?api-version=2015-06-01', '*') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/106ecc1c65d54ccdbd7afaf599a0a691\",\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/importListVersionCerts/106ecc1c65d54ccdbd7afaf599a0a691\",\"sid\":\"https://sdktestvault0511.vault.azure.net/secrets/importListVersionCerts/106ecc1c65d54ccdbd7afaf599a0a691\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"cer\":\"MIICODCCAeagAwIBAgIQqHmpBAv+CY9IJFoUhlbziTAJBgUrDgMCHQUAMBYxFDASBgNVBAMTC1Jvb3QgQWdlbmN5MB4XDTE1MDQyOTIxNTM0MVoXDTM5MTIzMTIzNTk1OVowFzEVMBMGA1UEAxMMS2V5VmF1bHRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bVAT73zr4+N4WVv2+SvTunAw08ksS4BrJW/nNliz3S9XuzMBMXvmYzU5HJ8TtEgluBiZZYd5qsMJD+OXHSNbsLdmMhni0jYX09h3XlC2VJw2sGKeYF+xEaavXm337aZZaZyjrFBrrUl51UePaN+kVFXNlBb3N3TYpqa7KokXenJQuR+i9Gv9a77c0UsSsDSryxppYhKK7HvTZCpKrhVtulF5iPMswWe9np3uggfMamyIsK/0L7X9w9B2qN7993RR0A00nOk4H6CnkuwO77dSsD0KJsk6FyAoZBzRXDZh9+d9R76zCL506NcQy/jl0lCiQYwsUX73PG5pxOh02OwKwIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAGqIjo2geVagzuzaZOe1ClGKhZeiCKfWAxklaGN+qlGUbVS4IN4V1lot3VKnzabasmkEHeNxPwLn1qvSD0cX9CE=\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471039697,\"updated\":1471039697},\"policy\":{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1469572877,\"updated\":1471039697}}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '2d113756-13b7-4b53-997d-c65b43fbd8e7', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:17 GMT', + connection: 'close', + 'content-length': '1814' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates/importListVersionCerts/versions?maxresults=2&api-version=2015-06-01') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/008b5b4fad3d4ef19f53588012928198\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470355583,\"updated\":1470355583}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/05c79999f3574c00be3e49bbf2e6a709\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471039160,\"updated\":1471039160}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZNRGs1UmtFd04wVXpNVEpCTkRFeU5VSTNNMEZEUkVRMVJERXhORE14TWpnaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '00843825-05e1-497d-a5b6-ef8af83c619d', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:18 GMT', + connection: 'close', + 'content-length': '954' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates/importListVersionCerts/versions?maxresults=2&api-version=2015-06-01') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/008b5b4fad3d4ef19f53588012928198\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470355583,\"updated\":1470355583}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/05c79999f3574c00be3e49bbf2e6a709\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471039160,\"updated\":1471039160}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZNRGs1UmtFd04wVXpNVEpCTkRFeU5VSTNNMEZEUkVRMVJERXhORE14TWpnaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '00843825-05e1-497d-a5b6-ef8af83c619d', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:18 GMT', + connection: 'close', + 'content-length': '954' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZNRGs1UmtFd04wVXpNVEpCTkRFeU5VSTNNMEZEUkVRMVJERXhORE14TWpnaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/099fa07e312a4125b73acdd5d1143128\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471036565,\"updated\":1471036565}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/0a7b67f6343f47918445e0b501f27cf1\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471039695,\"updated\":1471039695}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZNRUU0UVRGRE9VTTNNREkyTkRneU1FRXhRalpFTmtORFJEUXlNamt3UlVRaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '2c7171d2-7744-4075-85bc-29acf62eddd1', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:18 GMT', + connection: 'close', + 'content-length': '954' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZNRGs1UmtFd04wVXpNVEpCTkRFeU5VSTNNMEZEUkVRMVJERXhORE14TWpnaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/099fa07e312a4125b73acdd5d1143128\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471036565,\"updated\":1471036565}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/0a7b67f6343f47918445e0b501f27cf1\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471039695,\"updated\":1471039695}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZNRUU0UVRGRE9VTTNNREkyTkRneU1FRXhRalpFTmtORFJEUXlNamt3UlVRaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '2c7171d2-7744-4075-85bc-29acf62eddd1', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:18 GMT', + connection: 'close', + 'content-length': '954' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZNRUU0UVRGRE9VTTNNREkyTkRneU1FRXhRalpFTmtORFJEUXlNamt3UlVRaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/0a8a1c9c70264820a1b6d6ccd42290ed\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471026905,\"updated\":1471026905}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/106ecc1c65d54ccdbd7afaf599a0a691\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471039697,\"updated\":1471039697}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZNa1E1TkRrd1JrTTJPVVk1TkVRMlF6ZzFRVE5EUVVORFJEZ3pRME5DUXpFaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '9eb28a12-e37c-409c-a20a-59fe15f89cd0', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:19 GMT', + connection: 'close', + 'content-length': '954' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZNRUU0UVRGRE9VTTNNREkyTkRneU1FRXhRalpFTmtORFJEUXlNamt3UlVRaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/0a8a1c9c70264820a1b6d6ccd42290ed\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471026905,\"updated\":1471026905}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/106ecc1c65d54ccdbd7afaf599a0a691\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471039697,\"updated\":1471039697}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZNa1E1TkRrd1JrTTJPVVk1TkVRMlF6ZzFRVE5EUVVORFJEZ3pRME5DUXpFaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '9eb28a12-e37c-409c-a20a-59fe15f89cd0', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:19 GMT', + connection: 'close', + 'content-length': '954' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZNa1E1TkRrd1JrTTJPVVk1TkVRMlF6ZzFRVE5EUVVORFJEZ3pRME5DUXpFaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/2d9490fc69f94d6c85a3caccd83ccbc1\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470355166,\"updated\":1470355166}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/4ad744848d5647dbbcd5f66079c2a412\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470970203,\"updated\":1470970203}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZOVGxDTWtVelFqSTFNelkyTkVKRE9UZzNRelk0TmtVNVFUZzBRVFJGTmpBaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'ee7873e0-574b-4be9-a7ac-6d5a24f759d4', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:19 GMT', + connection: 'close', + 'content-length': '954' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZNa1E1TkRrd1JrTTJPVVk1TkVRMlF6ZzFRVE5EUVVORFJEZ3pRME5DUXpFaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/2d9490fc69f94d6c85a3caccd83ccbc1\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470355166,\"updated\":1470355166}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/4ad744848d5647dbbcd5f66079c2a412\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470970203,\"updated\":1470970203}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZOVGxDTWtVelFqSTFNelkyTkVKRE9UZzNRelk0TmtVNVFUZzBRVFJGTmpBaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'ee7873e0-574b-4be9-a7ac-6d5a24f759d4', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:19 GMT', + connection: 'close', + 'content-length': '954' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZOVGxDTWtVelFqSTFNelkyTkVKRE9UZzNRelk0TmtVNVFUZzBRVFJGTmpBaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/59b2e3b253664bc987c686e9a84a4e60\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1469573304,\"updated\":1469573304}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/5ac6c443f51047778e26271f3fea4587\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470959540,\"updated\":1470959540}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZOVU13TXpjNU1FSkRRakZETkRCR05Ea3lOa05HTVVWR09UbENNRUl3TURjaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'fb3e3cd0-6273-4399-9e03-dfd27b55ffe3', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:20 GMT', + connection: 'close', + 'content-length': '954' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZOVGxDTWtVelFqSTFNelkyTkVKRE9UZzNRelk0TmtVNVFUZzBRVFJGTmpBaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/59b2e3b253664bc987c686e9a84a4e60\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1469573304,\"updated\":1469573304}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/5ac6c443f51047778e26271f3fea4587\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470959540,\"updated\":1470959540}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZOVU13TXpjNU1FSkRRakZETkRCR05Ea3lOa05HTVVWR09UbENNRUl3TURjaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'fb3e3cd0-6273-4399-9e03-dfd27b55ffe3', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:20 GMT', + connection: 'close', + 'content-length': '954' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZOVU13TXpjNU1FSkRRakZETkRCR05Ea3lOa05HTVVWR09UbENNRUl3TURjaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/5c03790bcb1c40f4926cf1ef99b0b007\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471026907,\"updated\":1471026907}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/60407f316f7249f6a53e223071dcc82a\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470355164,\"updated\":1470355164}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZOa0pFT1VVd1F6aERPRVJGTkVNME5UZzRNRVl5TjBZeE1FUTBPVEZETkRBaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '39d090fb-df51-447e-888c-c44632cf7608', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:20 GMT', + connection: 'close', + 'content-length': '954' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZOVU13TXpjNU1FSkRRakZETkRCR05Ea3lOa05HTVVWR09UbENNRUl3TURjaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/5c03790bcb1c40f4926cf1ef99b0b007\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471026907,\"updated\":1471026907}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/60407f316f7249f6a53e223071dcc82a\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470355164,\"updated\":1470355164}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZOa0pFT1VVd1F6aERPRVJGTkVNME5UZzRNRVl5TjBZeE1FUTBPVEZETkRBaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '39d090fb-df51-447e-888c-c44632cf7608', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:20 GMT', + connection: 'close', + 'content-length': '954' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZOa0pFT1VVd1F6aERPRVJGTkVNME5UZzRNRVl5TjBZeE1FUTBPVEZETkRBaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/6bd9e0c8c8de4c45880f27f10d491c40\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470959375,\"updated\":1470959375}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/6c5f33f6a8e44dcdb6716a2794200805\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470449227,\"updated\":1470449227}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZOekZCTURGRFFVTkJOVFpETkVNNU4wRkRPVEZFUXpNM05VUTBNa0l6TkVRaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '2210fd1b-04ab-4c48-a8fd-f640bd365323', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:21 GMT', + connection: 'close', + 'content-length': '954' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZOa0pFT1VVd1F6aERPRVJGTkVNME5UZzRNRVl5TjBZeE1FUTBPVEZETkRBaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/6bd9e0c8c8de4c45880f27f10d491c40\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470959375,\"updated\":1470959375}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/6c5f33f6a8e44dcdb6716a2794200805\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470449227,\"updated\":1470449227}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZOekZCTURGRFFVTkJOVFpETkVNNU4wRkRPVEZFUXpNM05VUTBNa0l6TkVRaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '2210fd1b-04ab-4c48-a8fd-f640bd365323', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:21 GMT', + connection: 'close', + 'content-length': '954' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZOekZCTURGRFFVTkJOVFpETkVNNU4wRkRPVEZFUXpNM05VUTBNa0l6TkVRaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/71a01caca56c4c97ac91dc375d42b34d\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470449794,\"updated\":1470449794}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/755cae6bfaaf49b4bb58243d438b30b5\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470449680,\"updated\":1470449680}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZPREJDTkRneE5qVTBOVEU0TkVNd1JFSkNPVUV5TnpZNE1EYzJRVFV5UVVFaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'a13bc3e7-ccaf-4f15-85a4-f00f7fe3b1fa', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:21 GMT', + connection: 'close', + 'content-length': '954' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZOekZCTURGRFFVTkJOVFpETkVNNU4wRkRPVEZFUXpNM05VUTBNa0l6TkVRaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/71a01caca56c4c97ac91dc375d42b34d\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470449794,\"updated\":1470449794}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/755cae6bfaaf49b4bb58243d438b30b5\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470449680,\"updated\":1470449680}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZPREJDTkRneE5qVTBOVEU0TkVNd1JFSkNPVUV5TnpZNE1EYzJRVFV5UVVFaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'a13bc3e7-ccaf-4f15-85a4-f00f7fe3b1fa', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:21 GMT', + connection: 'close', + 'content-length': '954' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZPREJDTkRneE5qVTBOVEU0TkVNd1JFSkNPVUV5TnpZNE1EYzJRVFV5UVVFaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/80b4816545184c0dbb9a2768076a52aa\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471023838,\"updated\":1471023838}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/8da26c9af7224e7ba67e58145e99f912\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471036564,\"updated\":1471036564}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZPVFJETkROR01FUXlPVVUxTkRJME4wSXpPRU5GTmpjME5URkVNekJCTVVFaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '74d0b241-bfc9-472c-ba2d-bc3317b08da2', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:22 GMT', + connection: 'close', + 'content-length': '954' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZPREJDTkRneE5qVTBOVEU0TkVNd1JFSkNPVUV5TnpZNE1EYzJRVFV5UVVFaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/80b4816545184c0dbb9a2768076a52aa\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471023838,\"updated\":1471023838}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/8da26c9af7224e7ba67e58145e99f912\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471036564,\"updated\":1471036564}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZPVFJETkROR01FUXlPVVUxTkRJME4wSXpPRU5GTmpjME5URkVNekJCTVVFaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '74d0b241-bfc9-472c-ba2d-bc3317b08da2', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:22 GMT', + connection: 'close', + 'content-length': '954' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZPVFJETkROR01FUXlPVVUxTkRJME4wSXpPRU5GTmpjME5URkVNekJCTVVFaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/94c43f0d29e54247b38ce67451d30a1a\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1469573302,\"updated\":1469573302}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/9757926e899b4d04a83ced71213d4e44\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1469572879,\"updated\":1469572879}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZPVUZHUTBaRlJEVTVPREU0TkVSQlEwRTFORFUyUkRreFJEaEZSVVE1T1VFaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '9528b6dd-4ea0-48ea-9cd1-514d39b7597d', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:22 GMT', + connection: 'close', + 'content-length': '954' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZPVFJETkROR01FUXlPVVUxTkRJME4wSXpPRU5GTmpjME5URkVNekJCTVVFaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/94c43f0d29e54247b38ce67451d30a1a\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1469573302,\"updated\":1469573302}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/9757926e899b4d04a83ced71213d4e44\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1469572879,\"updated\":1469572879}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZPVUZHUTBaRlJEVTVPREU0TkVSQlEwRTFORFUyUkRreFJEaEZSVVE1T1VFaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '9528b6dd-4ea0-48ea-9cd1-514d39b7597d', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:22 GMT', + connection: 'close', + 'content-length': '954' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZPVUZHUTBaRlJEVTVPREU0TkVSQlEwRTFORFUyUkRreFJEaEZSVVE1T1VFaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/9afcfed598184daca5456d91d8eed99a\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470449795,\"updated\":1470449795}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/9d4257e1e45d4226b4c430d286bc3fac\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471036959,\"updated\":1471036959}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZPVVZGTkVWRU1FUkVRMEUxTkRBeVJrRXhNamRCTnpORE5rRkdSRUl5UlRZaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '476bedad-9686-4f3a-90f7-128bf2e8c1ce', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:23 GMT', + connection: 'close', + 'content-length': '954' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZPVUZHUTBaRlJEVTVPREU0TkVSQlEwRTFORFUyUkRreFJEaEZSVVE1T1VFaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/9afcfed598184daca5456d91d8eed99a\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470449795,\"updated\":1470449795}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/9d4257e1e45d4226b4c430d286bc3fac\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471036959,\"updated\":1471036959}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZPVVZGTkVWRU1FUkVRMEUxTkRBeVJrRXhNamRCTnpORE5rRkdSRUl5UlRZaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '476bedad-9686-4f3a-90f7-128bf2e8c1ce', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:23 GMT', + connection: 'close', + 'content-length': '954' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZPVVZGTkVWRU1FUkVRMEUxTkRBeVJrRXhNamRCTnpORE5rRkdSRUl5UlRZaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/9ee4ed0ddca5402fa127a73c6afdb2e6\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471026751,\"updated\":1471026751}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/a0b601cd426846a5af4a3457d2cfba3c\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470970205,\"updated\":1470970205}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZRVEV6TlVFMlJEaEROVGRDTkVRM1JUazJOakpEUWpRek1UZzJNell4TlRjaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'c6663416-7867-44c0-967c-8fa477ad9c1d', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:23 GMT', + connection: 'close', + 'content-length': '954' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZPVVZGTkVWRU1FUkVRMEUxTkRBeVJrRXhNamRCTnpORE5rRkdSRUl5UlRZaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/9ee4ed0ddca5402fa127a73c6afdb2e6\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471026751,\"updated\":1471026751}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/a0b601cd426846a5af4a3457d2cfba3c\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470970205,\"updated\":1470970205}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZRVEV6TlVFMlJEaEROVGRDTkVRM1JUazJOakpEUWpRek1UZzJNell4TlRjaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'c6663416-7867-44c0-967c-8fa477ad9c1d', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:23 GMT', + connection: 'close', + 'content-length': '954' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZRVEV6TlVFMlJEaEROVGRDTkVRM1JUazJOakpEUWpRek1UZzJNell4TlRjaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/a135a6d8c57b4d7e9662cb4318636157\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470959541,\"updated\":1470959541}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/b706dd94c90749eaa29ee2d98ca9ef45\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471036957,\"updated\":1471036957}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZRa0kxUkVFME1EWTVORVkwTkRZelEwSTFOVGRETmpBeFFqVTJOelZHTVRFaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '0721cf22-72e1-4af7-b4bf-9600f63fd4af', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:24 GMT', + connection: 'close', + 'content-length': '954' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZRVEV6TlVFMlJEaEROVGRDTkVRM1JUazJOakpEUWpRek1UZzJNell4TlRjaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/a135a6d8c57b4d7e9662cb4318636157\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470959541,\"updated\":1470959541}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/b706dd94c90749eaa29ee2d98ca9ef45\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471036957,\"updated\":1471036957}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZRa0kxUkVFME1EWTVORVkwTkRZelEwSTFOVGRETmpBeFFqVTJOelZHTVRFaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '0721cf22-72e1-4af7-b4bf-9600f63fd4af', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:24 GMT', + connection: 'close', + 'content-length': '954' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZRa0kxUkVFME1EWTVORVkwTkRZelEwSTFOVGRETmpBeFFqVTJOelZHTVRFaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/bb5da40694f4463cb557c601b5675f11\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470449677,\"updated\":1470449677}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/bd6ba2332b2248b39e3167916ee42d1e\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471020655,\"updated\":1471020655}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZRemd5UkVJM1F6UXhRa1l4TkVJMk5UZ3lPRGsyUXpnMVJVWkNRemhETkRRaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '4cd2d44e-a175-4895-ab96-0837d88ba9c7', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:24 GMT', + connection: 'close', + 'content-length': '954' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZRa0kxUkVFME1EWTVORVkwTkRZelEwSTFOVGRETmpBeFFqVTJOelZHTVRFaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/bb5da40694f4463cb557c601b5675f11\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470449677,\"updated\":1470449677}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/bd6ba2332b2248b39e3167916ee42d1e\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471020655,\"updated\":1471020655}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZRemd5UkVJM1F6UXhRa1l4TkVJMk5UZ3lPRGsyUXpnMVJVWkNRemhETkRRaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '4cd2d44e-a175-4895-ab96-0837d88ba9c7', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:24 GMT', + connection: 'close', + 'content-length': '954' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZRemd5UkVJM1F6UXhRa1l4TkVJMk5UZ3lPRGsyUXpnMVJVWkNRemhETkRRaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/c82db7c41bf14b6582896c85efbc8c44\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471026749,\"updated\":1471026749}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/cdd53ba9518c48fdb5586bd267e2038c\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470449228,\"updated\":1470449228}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZSREF4T1RNM01ESkJSamhGTkRGQ1JqaEJPVFJHTkRNMVJUWXlNRUk0TUVVaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '99292a87-9913-4863-a06a-567ca4952b26', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:24 GMT', + connection: 'close', + 'content-length': '954' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZRemd5UkVJM1F6UXhRa1l4TkVJMk5UZ3lPRGsyUXpnMVJVWkNRemhETkRRaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/c82db7c41bf14b6582896c85efbc8c44\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471026749,\"updated\":1471026749}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/cdd53ba9518c48fdb5586bd267e2038c\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470449228,\"updated\":1470449228}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZSREF4T1RNM01ESkJSamhGTkRGQ1JqaEJPVFJHTkRNMVJUWXlNRUk0TUVVaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '99292a87-9913-4863-a06a-567ca4952b26', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:24 GMT', + connection: 'close', + 'content-length': '954' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZSREF4T1RNM01ESkJSamhGTkRGQ1JqaEJPVFJHTkRNMVJUWXlNRUk0TUVVaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/d0193702af8e41bf8a94f435e620b80e\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471039162,\"updated\":1471039162}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/d4a6facca0ef496289779a43a7ce7003\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471020653,\"updated\":1471020653}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZSRVUwTXpBMU9ESTRNRGMwTkVNMk0wSkZSak15UmtGR01FVkVPRGt6UTBNaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '149ae120-cadd-4f5c-a3a7-9ef58c8d1d48', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:25 GMT', + connection: 'close', + 'content-length': '954' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZSREF4T1RNM01ESkJSamhGTkRGQ1JqaEJPVFJHTkRNMVJUWXlNRUk0TUVVaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/d0193702af8e41bf8a94f435e620b80e\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471039162,\"updated\":1471039162}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/d4a6facca0ef496289779a43a7ce7003\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471020653,\"updated\":1471020653}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZSRVUwTXpBMU9ESTRNRGMwTkVNMk0wSkZSak15UmtGR01FVkVPRGt6UTBNaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '149ae120-cadd-4f5c-a3a7-9ef58c8d1d48', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:25 GMT', + connection: 'close', + 'content-length': '954' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZSRVUwTXpBMU9ESTRNRGMwTkVNMk0wSkZSak15UmtGR01FVkVPRGt6UTBNaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/de43058280744c63bef32faf0ed893cc\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1469572877,\"updated\":1469572877}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/ee55a88f7d8147cda0150382868daeb3\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470959376,\"updated\":1470959376}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZSakJCTjBJeE5UUTJPREV5TkVNME5VSXlRamN3TjBNek1FUXpPRGxDT1RZaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'a8f1d88d-ae7e-42a2-a059-d04791cb0001', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:26 GMT', + connection: 'close', + 'content-length': '954' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZSRVUwTXpBMU9ESTRNRGMwTkVNMk0wSkZSak15UmtGR01FVkVPRGt6UTBNaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/de43058280744c63bef32faf0ed893cc\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1469572877,\"updated\":1469572877}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/ee55a88f7d8147cda0150382868daeb3\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470959376,\"updated\":1470959376}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZSakJCTjBJeE5UUTJPREV5TkVNME5VSXlRamN3TjBNek1FUXpPRGxDT1RZaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'a8f1d88d-ae7e-42a2-a059-d04791cb0001', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:26 GMT', + connection: 'close', + 'content-length': '954' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZSakJCTjBJeE5UUTJPREV5TkVNME5VSXlRamN3TjBNek1FUXpPRGxDT1RZaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/f0a7b15468124c45b2b707c30d389b96\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471023837,\"updated\":1471023837}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/fda6fef0af9e4c1da0fab3e05edfb4b5\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470355581,\"updated\":1470355581}}],\"nextLink\":null}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '7e884719-4701-4b6c-9c83-53b6e1087525', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:26 GMT', + connection: 'close', + 'content-length': '549' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates/importListVersionCerts/versions?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExNjAhTURBd01EYzJJV05sY25ScFptbGpZWFJsTDBsTlVFOVNWRXhKVTFSV1JWSlRTVTlPUTBWU1ZGTXZWa1ZTVTBsUFRsTXZSakJCTjBJeE5UUTJPREV5TkVNME5VSXlRamN3TjBNek1FUXpPRGxDT1RZaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/f0a7b15468124c45b2b707c30d389b96\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471023837,\"updated\":1471023837}},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/importListVersionCerts/fda6fef0af9e4c1da0fab3e05edfb4b5\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470355581,\"updated\":1470355581}}],\"nextLink\":null}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '7e884719-4701-4b6c-9c83-53b6e1087525', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:26 GMT', + connection: 'close', + 'content-length': '549' }); + return result; }], +[function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.put('/certificates/issuers/nodeIssuer?api-version=2015-06-01', '*') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/issuers/nodeIssuer\",\"provider\":\"test\",\"credentials\":{\"account_id\":\"keyvaultuser\"},\"org_details\":{\"zip\":0,\"admin_details\":[{\"first_name\":\"Jane\",\"last_name\":\"Doe\",\"email\":\"admin@contoso.com\",\"phone\":\"4256666666\"}]},\"attributes\":{\"enabled\":true,\"created\":1471039707,\"updated\":1471039707}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'cf660d99-8208-483c-b537-ce2d55c7ac50', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:26 GMT', + connection: 'close', + 'content-length': '346' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.put('/certificates/issuers/nodeIssuer?api-version=2015-06-01', '*') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/issuers/nodeIssuer\",\"provider\":\"test\",\"credentials\":{\"account_id\":\"keyvaultuser\"},\"org_details\":{\"zip\":0,\"admin_details\":[{\"first_name\":\"Jane\",\"last_name\":\"Doe\",\"email\":\"admin@contoso.com\",\"phone\":\"4256666666\"}]},\"attributes\":{\"enabled\":true,\"created\":1471039707,\"updated\":1471039707}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'cf660d99-8208-483c-b537-ce2d55c7ac50', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:26 GMT', + connection: 'close', + 'content-length': '346' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates/issuers/nodeIssuer?api-version=2015-06-01') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/issuers/nodeIssuer\",\"provider\":\"test\",\"credentials\":{\"account_id\":\"keyvaultuser\"},\"org_details\":{\"zip\":0,\"admin_details\":[{\"first_name\":\"Jane\",\"last_name\":\"Doe\",\"email\":\"admin@contoso.com\",\"phone\":\"4256666666\"}]},\"attributes\":{\"enabled\":true,\"created\":1471039707,\"updated\":1471039707}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '30ef48a9-8a1d-45bd-9b0f-b930de548a31', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:27 GMT', + connection: 'close', + 'content-length': '346' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates/issuers/nodeIssuer?api-version=2015-06-01') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/issuers/nodeIssuer\",\"provider\":\"test\",\"credentials\":{\"account_id\":\"keyvaultuser\"},\"org_details\":{\"zip\":0,\"admin_details\":[{\"first_name\":\"Jane\",\"last_name\":\"Doe\",\"email\":\"admin@contoso.com\",\"phone\":\"4256666666\"}]},\"attributes\":{\"enabled\":true,\"created\":1471039707,\"updated\":1471039707}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '30ef48a9-8a1d-45bd-9b0f-b930de548a31', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:27 GMT', + connection: 'close', + 'content-length': '346' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.patch('/certificates/issuers/nodeIssuer?api-version=2015-06-01', '*') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/issuers/nodeIssuer\",\"provider\":\"test\",\"credentials\":{\"account_id\":\"xboxuser\"},\"org_details\":{\"zip\":0,\"admin_details\":[{\"first_name\":\"Jane II\",\"last_name\":\"Doe\",\"email\":\"admin@contoso2.com\",\"phone\":\"1111111111\"}]},\"attributes\":{\"enabled\":true,\"created\":1471039707,\"updated\":1471039708}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '71a886b4-7e34-4d47-a1ee-b93a0e5640f5', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:28 GMT', + connection: 'close', + 'content-length': '346' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.patch('/certificates/issuers/nodeIssuer?api-version=2015-06-01', '*') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/issuers/nodeIssuer\",\"provider\":\"test\",\"credentials\":{\"account_id\":\"xboxuser\"},\"org_details\":{\"zip\":0,\"admin_details\":[{\"first_name\":\"Jane II\",\"last_name\":\"Doe\",\"email\":\"admin@contoso2.com\",\"phone\":\"1111111111\"}]},\"attributes\":{\"enabled\":true,\"created\":1471039707,\"updated\":1471039708}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '71a886b4-7e34-4d47-a1ee-b93a0e5640f5', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:28 GMT', + connection: 'close', + 'content-length': '346' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .delete('/certificates/issuers/nodeIssuer?api-version=2015-06-01') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/issuers/nodeIssuer\",\"provider\":\"test\",\"credentials\":{\"account_id\":\"xboxuser\"},\"org_details\":{\"zip\":0,\"admin_details\":[{\"first_name\":\"Jane II\",\"last_name\":\"Doe\",\"email\":\"admin@contoso2.com\",\"phone\":\"1111111111\"}]},\"attributes\":{\"enabled\":true,\"created\":1471039707,\"updated\":1471039708}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '63b69cc7-8935-473a-ba7e-647b5cf9e874', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:28 GMT', + connection: 'close', + 'content-length': '346' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .delete('/certificates/issuers/nodeIssuer?api-version=2015-06-01') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/issuers/nodeIssuer\",\"provider\":\"test\",\"credentials\":{\"account_id\":\"xboxuser\"},\"org_details\":{\"zip\":0,\"admin_details\":[{\"first_name\":\"Jane II\",\"last_name\":\"Doe\",\"email\":\"admin@contoso2.com\",\"phone\":\"1111111111\"}]},\"attributes\":{\"enabled\":true,\"created\":1471039707,\"updated\":1471039708}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '63b69cc7-8935-473a-ba7e-647b5cf9e874', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:28 GMT', + connection: 'close', + 'content-length': '346' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates/issuers/nodeIssuer?api-version=2015-06-01') + .reply(404, "{\"error\":{\"code\":\"CertificateIssuerNotFound\",\"message\":\"Issuer not found\"}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-length': '75', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '4f2f6e5d-6c02-463b-bebc-bc4381765472', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:28 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates/issuers/nodeIssuer?api-version=2015-06-01') + .reply(404, "{\"error\":{\"code\":\"CertificateIssuerNotFound\",\"message\":\"Issuer not found\"}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-length': '75', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '4f2f6e5d-6c02-463b-bebc-bc4381765472', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:28 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.put('/certificates/issuers/nodeIssuer1?api-version=2015-06-01', '*') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/issuers/nodeIssuer1\",\"provider\":\"test\",\"credentials\":{\"account_id\":\"keyvaultuser\"},\"org_details\":{\"zip\":0,\"admin_details\":[{\"first_name\":\"Jane\",\"last_name\":\"Doe\",\"email\":\"admin@contoso.com\",\"phone\":\"4256666666\"}]},\"attributes\":{\"enabled\":true,\"created\":1467158231,\"updated\":1471039709}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'd2cf4152-76ee-4956-8b79-4f45c9ff65a6', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:29 GMT', + connection: 'close', + 'content-length': '347' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.put('/certificates/issuers/nodeIssuer1?api-version=2015-06-01', '*') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/issuers/nodeIssuer1\",\"provider\":\"test\",\"credentials\":{\"account_id\":\"keyvaultuser\"},\"org_details\":{\"zip\":0,\"admin_details\":[{\"first_name\":\"Jane\",\"last_name\":\"Doe\",\"email\":\"admin@contoso.com\",\"phone\":\"4256666666\"}]},\"attributes\":{\"enabled\":true,\"created\":1467158231,\"updated\":1471039709}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'd2cf4152-76ee-4956-8b79-4f45c9ff65a6', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:29 GMT', + connection: 'close', + 'content-length': '347' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.put('/certificates/issuers/nodeIssuer2?api-version=2015-06-01', '*') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/issuers/nodeIssuer2\",\"provider\":\"test\",\"credentials\":{\"account_id\":\"keyvaultuser\"},\"org_details\":{\"zip\":0,\"admin_details\":[{\"first_name\":\"Jane\",\"last_name\":\"Doe\",\"email\":\"admin@contoso.com\",\"phone\":\"4256666666\"}]},\"attributes\":{\"enabled\":true,\"created\":1466812762,\"updated\":1471039709}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'e3b897d8-c2a8-4d61-a8ee-242d1c4aad04', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:29 GMT', + connection: 'close', + 'content-length': '347' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.put('/certificates/issuers/nodeIssuer2?api-version=2015-06-01', '*') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/issuers/nodeIssuer2\",\"provider\":\"test\",\"credentials\":{\"account_id\":\"keyvaultuser\"},\"org_details\":{\"zip\":0,\"admin_details\":[{\"first_name\":\"Jane\",\"last_name\":\"Doe\",\"email\":\"admin@contoso.com\",\"phone\":\"4256666666\"}]},\"attributes\":{\"enabled\":true,\"created\":1466812762,\"updated\":1471039709}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'e3b897d8-c2a8-4d61-a8ee-242d1c4aad04', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:29 GMT', + connection: 'close', + 'content-length': '347' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates/issuers?maxresults=2&api-version=2015-06-01') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/issuers/createCertificateJavaPemIssuer01\",\"provider\":\"Test\"},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/issuers/createCertificateJavaPkcs12Issuer01\",\"provider\":\"Test\"}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/issuers?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5NiFNREF3TURJNElXTmxjblJwWm1sallYUmxMMGxUVTFWRlVsTXZTVk5UVlVWU01ETWhNREF3TURJNElUSXdNVFl0TURVdE1UZFVNVGM2TkRBNk16SXVNekEyTnpBMk1Wb2giLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '83289919-dc36-4d23-b8f0-bdba05f7a0d1', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:29 GMT', + connection: 'close', + 'content-length': '568' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates/issuers?maxresults=2&api-version=2015-06-01') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/issuers/createCertificateJavaPemIssuer01\",\"provider\":\"Test\"},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/issuers/createCertificateJavaPkcs12Issuer01\",\"provider\":\"Test\"}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/issuers?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5NiFNREF3TURJNElXTmxjblJwWm1sallYUmxMMGxUVTFWRlVsTXZTVk5UVlVWU01ETWhNREF3TURJNElUSXdNVFl0TURVdE1UZFVNVGM2TkRBNk16SXVNekEyTnpBMk1Wb2giLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '83289919-dc36-4d23-b8f0-bdba05f7a0d1', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:29 GMT', + connection: 'close', + 'content-length': '568' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates/issuers?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5NiFNREF3TURJNElXTmxjblJwWm1sallYUmxMMGxUVTFWRlVsTXZTVk5UVlVWU01ETWhNREF3TURJNElUSXdNVFl0TURVdE1UZFVNVGM2TkRBNk16SXVNekEyTnpBMk1Wb2giLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/issuers/issuer03\",\"provider\":\"Test\"},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/issuers/nodeIssuer1\",\"provider\":\"test\"}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/issuers?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDAhTURBd01ETXhJV05sY25ScFptbGpZWFJsTDBsVFUxVkZVbE12VGs5RVJVbFRVMVZGVWpJaE1EQXdNREk0SVRJd01UWXRNRFl0TWpWVU1EQTZNREU2TlRNdU1ETTFNemt4TVZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '1c025c0c-eefb-4495-ae46-5a3301e68b21', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:30 GMT', + connection: 'close', + 'content-length': '527' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates/issuers?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5NiFNREF3TURJNElXTmxjblJwWm1sallYUmxMMGxUVTFWRlVsTXZTVk5UVlVWU01ETWhNREF3TURJNElUSXdNVFl0TURVdE1UZFVNVGM2TkRBNk16SXVNekEyTnpBMk1Wb2giLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/issuers/issuer03\",\"provider\":\"Test\"},{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/issuers/nodeIssuer1\",\"provider\":\"test\"}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/certificates/issuers?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDAhTURBd01ETXhJV05sY25ScFptbGpZWFJsTDBsVFUxVkZVbE12VGs5RVJVbFRVMVZGVWpJaE1EQXdNREk0SVRJd01UWXRNRFl0TWpWVU1EQTZNREU2TlRNdU1ETTFNemt4TVZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '1c025c0c-eefb-4495-ae46-5a3301e68b21', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:30 GMT', + connection: 'close', + 'content-length': '527' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates/issuers?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDAhTURBd01ETXhJV05sY25ScFptbGpZWFJsTDBsVFUxVkZVbE12VGs5RVJVbFRVMVZGVWpJaE1EQXdNREk0SVRJd01UWXRNRFl0TWpWVU1EQTZNREU2TlRNdU1ETTFNemt4TVZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/issuers/nodeIssuer2\",\"provider\":\"test\"}],\"nextLink\":null}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'aa85b1f0-3f60-463d-92f6-e29d81cb3c9c', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:31 GMT', + connection: 'close', + 'content-length': '128' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates/issuers?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDAhTURBd01ETXhJV05sY25ScFptbGpZWFJsTDBsVFUxVkZVbE12VGs5RVJVbFRVMVZGVWpJaE1EQXdNREk0SVRJd01UWXRNRFl0TWpWVU1EQTZNREU2TlRNdU1ETTFNemt4TVZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/issuers/nodeIssuer2\",\"provider\":\"test\"}],\"nextLink\":null}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'aa85b1f0-3f60-463d-92f6-e29d81cb3c9c', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:31 GMT', + connection: 'close', + 'content-length': '128' }); + return result; }], +[function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.post('/certificates/asyncCancelledDeletedCert/create?api-version=2015-06-01', '*') + .reply(202, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/asyncCancelledDeletedCert/pending\",\"issuer\":{\"name\":\"Self\"},\"csr\":\"MIICqjCCAZICAQAwGjEYMBYGA1UEAwwPKi5taWNyb3NvZnQuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqfZfWegDcbXnvd/su/DAuUr64fPOqrFUGT9XmkNATIf0N15pAd46vUgOvAJ2xo1wgc66QF6xzQbbGzqyL38cVCEAbt51sZ4BRZXa6QhuJnuIv/qBXjlyhYiJHqwcaEjX1xH6z0SUAGulzvtsLhGUgWB+UGh8Bu1iIxw6Ymrd4OcyGdQqxT402S2mvE4hSgITnLepae1hyF2CYFFvRQuVOqCfgX99wi0A1vtllhS3LTqb42StgoGuufqrwGae7SpIVgdFOzxS3+1XQk6W7sS2QfG4SFbvQUhsOWRO+D51k/sKxWJC0PhP22GtOm/cEiH7FS62wrKLiEG1uxWvLbtg8wIDAQABoEswSQYJKoZIhvcNAQkOMTwwOjAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMAkGA1UdEwQCMAAwDQYJKoZIhvcNAQELBQADggEBAJS5h1xcZ8dW9hgF6BlcKvHhLsBKqAynIa0JnBQRpxtee+w8hjgmM3aULMBdthsgIVSkfgdG8Y7A0isjXhKr+rXSOLnAasSxcEFgUf9g17ssSPrcT5+9ZF4XTVtJPEV6h3d8hlnwySYn1WsEkN4lYenih/7rHGRKbVOxXs1C5IgSwHSVDxjeeppxbC1l85KLz6FZJFx1XyuZiKhTAfwkxlR8kjXbBBasm0hBL58LkBg1re5wMjFYnh2qAB41yxA7YOQm4aoThgkN6gd9TfPyL/gG6e1I/dwQFCKp0B1RiPx4IZmvT3dIGDslQv9FpxpdB91XPTMm3bXrpHZcG3XiQw0=\",\"cancellation_requested\":false,\"status\":\"inProgress\",\"status_details\":\"Pending certificate created. Certificate request is in progress. This may take some time based on the issuer provider. Please check again later.\",\"request_id\":\"cfd5b1300dc944dab29b6f79af9558e1\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + location: 'https://sdktestvault0511.vault.azure.net/certificates/asyncCancelledDeletedCert/pending?api-version=2015-06-01&request_id=cfd5b1300dc944dab29b6f79af9558e1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '89b1b047-8bd6-4fab-9bad-9ede53a27577', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:33 GMT', + connection: 'close', + 'content-length': '1311' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.post('/certificates/asyncCancelledDeletedCert/create?api-version=2015-06-01', '*') + .reply(202, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/asyncCancelledDeletedCert/pending\",\"issuer\":{\"name\":\"Self\"},\"csr\":\"MIICqjCCAZICAQAwGjEYMBYGA1UEAwwPKi5taWNyb3NvZnQuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqfZfWegDcbXnvd/su/DAuUr64fPOqrFUGT9XmkNATIf0N15pAd46vUgOvAJ2xo1wgc66QF6xzQbbGzqyL38cVCEAbt51sZ4BRZXa6QhuJnuIv/qBXjlyhYiJHqwcaEjX1xH6z0SUAGulzvtsLhGUgWB+UGh8Bu1iIxw6Ymrd4OcyGdQqxT402S2mvE4hSgITnLepae1hyF2CYFFvRQuVOqCfgX99wi0A1vtllhS3LTqb42StgoGuufqrwGae7SpIVgdFOzxS3+1XQk6W7sS2QfG4SFbvQUhsOWRO+D51k/sKxWJC0PhP22GtOm/cEiH7FS62wrKLiEG1uxWvLbtg8wIDAQABoEswSQYJKoZIhvcNAQkOMTwwOjAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMAkGA1UdEwQCMAAwDQYJKoZIhvcNAQELBQADggEBAJS5h1xcZ8dW9hgF6BlcKvHhLsBKqAynIa0JnBQRpxtee+w8hjgmM3aULMBdthsgIVSkfgdG8Y7A0isjXhKr+rXSOLnAasSxcEFgUf9g17ssSPrcT5+9ZF4XTVtJPEV6h3d8hlnwySYn1WsEkN4lYenih/7rHGRKbVOxXs1C5IgSwHSVDxjeeppxbC1l85KLz6FZJFx1XyuZiKhTAfwkxlR8kjXbBBasm0hBL58LkBg1re5wMjFYnh2qAB41yxA7YOQm4aoThgkN6gd9TfPyL/gG6e1I/dwQFCKp0B1RiPx4IZmvT3dIGDslQv9FpxpdB91XPTMm3bXrpHZcG3XiQw0=\",\"cancellation_requested\":false,\"status\":\"inProgress\",\"status_details\":\"Pending certificate created. Certificate request is in progress. This may take some time based on the issuer provider. Please check again later.\",\"request_id\":\"cfd5b1300dc944dab29b6f79af9558e1\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + location: 'https://sdktestvault0511.vault.azure.net/certificates/asyncCancelledDeletedCert/pending?api-version=2015-06-01&request_id=cfd5b1300dc944dab29b6f79af9558e1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '89b1b047-8bd6-4fab-9bad-9ede53a27577', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:33 GMT', + connection: 'close', + 'content-length': '1311' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.patch('/certificates/asyncCancelledDeletedCert/pending?api-version=2015-06-01', '*') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/asyncCancelledDeletedCert/pending\",\"issuer\":{\"name\":\"Self\"},\"csr\":\"MIICqjCCAZICAQAwGjEYMBYGA1UEAwwPKi5taWNyb3NvZnQuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqfZfWegDcbXnvd/su/DAuUr64fPOqrFUGT9XmkNATIf0N15pAd46vUgOvAJ2xo1wgc66QF6xzQbbGzqyL38cVCEAbt51sZ4BRZXa6QhuJnuIv/qBXjlyhYiJHqwcaEjX1xH6z0SUAGulzvtsLhGUgWB+UGh8Bu1iIxw6Ymrd4OcyGdQqxT402S2mvE4hSgITnLepae1hyF2CYFFvRQuVOqCfgX99wi0A1vtllhS3LTqb42StgoGuufqrwGae7SpIVgdFOzxS3+1XQk6W7sS2QfG4SFbvQUhsOWRO+D51k/sKxWJC0PhP22GtOm/cEiH7FS62wrKLiEG1uxWvLbtg8wIDAQABoEswSQYJKoZIhvcNAQkOMTwwOjAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMAkGA1UdEwQCMAAwDQYJKoZIhvcNAQELBQADggEBAJS5h1xcZ8dW9hgF6BlcKvHhLsBKqAynIa0JnBQRpxtee+w8hjgmM3aULMBdthsgIVSkfgdG8Y7A0isjXhKr+rXSOLnAasSxcEFgUf9g17ssSPrcT5+9ZF4XTVtJPEV6h3d8hlnwySYn1WsEkN4lYenih/7rHGRKbVOxXs1C5IgSwHSVDxjeeppxbC1l85KLz6FZJFx1XyuZiKhTAfwkxlR8kjXbBBasm0hBL58LkBg1re5wMjFYnh2qAB41yxA7YOQm4aoThgkN6gd9TfPyL/gG6e1I/dwQFCKp0B1RiPx4IZmvT3dIGDslQv9FpxpdB91XPTMm3bXrpHZcG3XiQw0=\",\"cancellation_requested\":true,\"status\":\"inProgress\",\"status_details\":\"Pending certificate created. Certificate request is in progress. This may take some time based on the issuer provider. Please check again later.\",\"request_id\":\"cfd5b1300dc944dab29b6f79af9558e1\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'd0789ba2-63c4-43ad-8fdf-26146d0b235b', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:33 GMT', + connection: 'close', + 'content-length': '1310' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.patch('/certificates/asyncCancelledDeletedCert/pending?api-version=2015-06-01', '*') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/asyncCancelledDeletedCert/pending\",\"issuer\":{\"name\":\"Self\"},\"csr\":\"MIICqjCCAZICAQAwGjEYMBYGA1UEAwwPKi5taWNyb3NvZnQuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqfZfWegDcbXnvd/su/DAuUr64fPOqrFUGT9XmkNATIf0N15pAd46vUgOvAJ2xo1wgc66QF6xzQbbGzqyL38cVCEAbt51sZ4BRZXa6QhuJnuIv/qBXjlyhYiJHqwcaEjX1xH6z0SUAGulzvtsLhGUgWB+UGh8Bu1iIxw6Ymrd4OcyGdQqxT402S2mvE4hSgITnLepae1hyF2CYFFvRQuVOqCfgX99wi0A1vtllhS3LTqb42StgoGuufqrwGae7SpIVgdFOzxS3+1XQk6W7sS2QfG4SFbvQUhsOWRO+D51k/sKxWJC0PhP22GtOm/cEiH7FS62wrKLiEG1uxWvLbtg8wIDAQABoEswSQYJKoZIhvcNAQkOMTwwOjAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMAkGA1UdEwQCMAAwDQYJKoZIhvcNAQELBQADggEBAJS5h1xcZ8dW9hgF6BlcKvHhLsBKqAynIa0JnBQRpxtee+w8hjgmM3aULMBdthsgIVSkfgdG8Y7A0isjXhKr+rXSOLnAasSxcEFgUf9g17ssSPrcT5+9ZF4XTVtJPEV6h3d8hlnwySYn1WsEkN4lYenih/7rHGRKbVOxXs1C5IgSwHSVDxjeeppxbC1l85KLz6FZJFx1XyuZiKhTAfwkxlR8kjXbBBasm0hBL58LkBg1re5wMjFYnh2qAB41yxA7YOQm4aoThgkN6gd9TfPyL/gG6e1I/dwQFCKp0B1RiPx4IZmvT3dIGDslQv9FpxpdB91XPTMm3bXrpHZcG3XiQw0=\",\"cancellation_requested\":true,\"status\":\"inProgress\",\"status_details\":\"Pending certificate created. Certificate request is in progress. This may take some time based on the issuer provider. Please check again later.\",\"request_id\":\"cfd5b1300dc944dab29b6f79af9558e1\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'd0789ba2-63c4-43ad-8fdf-26146d0b235b', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:33 GMT', + connection: 'close', + 'content-length': '1310' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates/asyncCancelledDeletedCert/pending?api-version=2015-06-01') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/asyncCancelledDeletedCert/pending\",\"issuer\":{\"name\":\"Self\"},\"csr\":\"MIICqjCCAZICAQAwGjEYMBYGA1UEAwwPKi5taWNyb3NvZnQuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqfZfWegDcbXnvd/su/DAuUr64fPOqrFUGT9XmkNATIf0N15pAd46vUgOvAJ2xo1wgc66QF6xzQbbGzqyL38cVCEAbt51sZ4BRZXa6QhuJnuIv/qBXjlyhYiJHqwcaEjX1xH6z0SUAGulzvtsLhGUgWB+UGh8Bu1iIxw6Ymrd4OcyGdQqxT402S2mvE4hSgITnLepae1hyF2CYFFvRQuVOqCfgX99wi0A1vtllhS3LTqb42StgoGuufqrwGae7SpIVgdFOzxS3+1XQk6W7sS2QfG4SFbvQUhsOWRO+D51k/sKxWJC0PhP22GtOm/cEiH7FS62wrKLiEG1uxWvLbtg8wIDAQABoEswSQYJKoZIhvcNAQkOMTwwOjAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMAkGA1UdEwQCMAAwDQYJKoZIhvcNAQELBQADggEBAJS5h1xcZ8dW9hgF6BlcKvHhLsBKqAynIa0JnBQRpxtee+w8hjgmM3aULMBdthsgIVSkfgdG8Y7A0isjXhKr+rXSOLnAasSxcEFgUf9g17ssSPrcT5+9ZF4XTVtJPEV6h3d8hlnwySYn1WsEkN4lYenih/7rHGRKbVOxXs1C5IgSwHSVDxjeeppxbC1l85KLz6FZJFx1XyuZiKhTAfwkxlR8kjXbBBasm0hBL58LkBg1re5wMjFYnh2qAB41yxA7YOQm4aoThgkN6gd9TfPyL/gG6e1I/dwQFCKp0B1RiPx4IZmvT3dIGDslQv9FpxpdB91XPTMm3bXrpHZcG3XiQw0=\",\"cancellation_requested\":true,\"status\":\"inProgress\",\"status_details\":\"Pending certificate created. Certificate request is in progress. This may take some time based on the issuer provider. Please check again later.\",\"request_id\":\"cfd5b1300dc944dab29b6f79af9558e1\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'ddca137e-6ce9-41c8-ad98-dd9c76a6c417', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:34 GMT', + connection: 'close', + 'content-length': '1310' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates/asyncCancelledDeletedCert/pending?api-version=2015-06-01') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/asyncCancelledDeletedCert/pending\",\"issuer\":{\"name\":\"Self\"},\"csr\":\"MIICqjCCAZICAQAwGjEYMBYGA1UEAwwPKi5taWNyb3NvZnQuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqfZfWegDcbXnvd/su/DAuUr64fPOqrFUGT9XmkNATIf0N15pAd46vUgOvAJ2xo1wgc66QF6xzQbbGzqyL38cVCEAbt51sZ4BRZXa6QhuJnuIv/qBXjlyhYiJHqwcaEjX1xH6z0SUAGulzvtsLhGUgWB+UGh8Bu1iIxw6Ymrd4OcyGdQqxT402S2mvE4hSgITnLepae1hyF2CYFFvRQuVOqCfgX99wi0A1vtllhS3LTqb42StgoGuufqrwGae7SpIVgdFOzxS3+1XQk6W7sS2QfG4SFbvQUhsOWRO+D51k/sKxWJC0PhP22GtOm/cEiH7FS62wrKLiEG1uxWvLbtg8wIDAQABoEswSQYJKoZIhvcNAQkOMTwwOjAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMAkGA1UdEwQCMAAwDQYJKoZIhvcNAQELBQADggEBAJS5h1xcZ8dW9hgF6BlcKvHhLsBKqAynIa0JnBQRpxtee+w8hjgmM3aULMBdthsgIVSkfgdG8Y7A0isjXhKr+rXSOLnAasSxcEFgUf9g17ssSPrcT5+9ZF4XTVtJPEV6h3d8hlnwySYn1WsEkN4lYenih/7rHGRKbVOxXs1C5IgSwHSVDxjeeppxbC1l85KLz6FZJFx1XyuZiKhTAfwkxlR8kjXbBBasm0hBL58LkBg1re5wMjFYnh2qAB41yxA7YOQm4aoThgkN6gd9TfPyL/gG6e1I/dwQFCKp0B1RiPx4IZmvT3dIGDslQv9FpxpdB91XPTMm3bXrpHZcG3XiQw0=\",\"cancellation_requested\":true,\"status\":\"inProgress\",\"status_details\":\"Pending certificate created. Certificate request is in progress. This may take some time based on the issuer provider. Please check again later.\",\"request_id\":\"cfd5b1300dc944dab29b6f79af9558e1\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'ddca137e-6ce9-41c8-ad98-dd9c76a6c417', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:34 GMT', + connection: 'close', + 'content-length': '1310' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .delete('/certificates/asyncCancelledDeletedCert/pending?api-version=2015-06-01') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/asyncCancelledDeletedCert/pending\",\"issuer\":{\"name\":\"Self\"},\"csr\":\"MIICqjCCAZICAQAwGjEYMBYGA1UEAwwPKi5taWNyb3NvZnQuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqfZfWegDcbXnvd/su/DAuUr64fPOqrFUGT9XmkNATIf0N15pAd46vUgOvAJ2xo1wgc66QF6xzQbbGzqyL38cVCEAbt51sZ4BRZXa6QhuJnuIv/qBXjlyhYiJHqwcaEjX1xH6z0SUAGulzvtsLhGUgWB+UGh8Bu1iIxw6Ymrd4OcyGdQqxT402S2mvE4hSgITnLepae1hyF2CYFFvRQuVOqCfgX99wi0A1vtllhS3LTqb42StgoGuufqrwGae7SpIVgdFOzxS3+1XQk6W7sS2QfG4SFbvQUhsOWRO+D51k/sKxWJC0PhP22GtOm/cEiH7FS62wrKLiEG1uxWvLbtg8wIDAQABoEswSQYJKoZIhvcNAQkOMTwwOjAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMAkGA1UdEwQCMAAwDQYJKoZIhvcNAQELBQADggEBAJS5h1xcZ8dW9hgF6BlcKvHhLsBKqAynIa0JnBQRpxtee+w8hjgmM3aULMBdthsgIVSkfgdG8Y7A0isjXhKr+rXSOLnAasSxcEFgUf9g17ssSPrcT5+9ZF4XTVtJPEV6h3d8hlnwySYn1WsEkN4lYenih/7rHGRKbVOxXs1C5IgSwHSVDxjeeppxbC1l85KLz6FZJFx1XyuZiKhTAfwkxlR8kjXbBBasm0hBL58LkBg1re5wMjFYnh2qAB41yxA7YOQm4aoThgkN6gd9TfPyL/gG6e1I/dwQFCKp0B1RiPx4IZmvT3dIGDslQv9FpxpdB91XPTMm3bXrpHZcG3XiQw0=\",\"cancellation_requested\":true,\"status\":\"inProgress\",\"status_details\":\"Pending certificate created. Certificate request is in progress. This may take some time based on the issuer provider. Please check again later.\",\"request_id\":\"cfd5b1300dc944dab29b6f79af9558e1\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '70b770e6-7cff-4cce-9676-fd1c72889d86', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:34 GMT', + connection: 'close', + 'content-length': '1310' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .delete('/certificates/asyncCancelledDeletedCert/pending?api-version=2015-06-01') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/asyncCancelledDeletedCert/pending\",\"issuer\":{\"name\":\"Self\"},\"csr\":\"MIICqjCCAZICAQAwGjEYMBYGA1UEAwwPKi5taWNyb3NvZnQuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqfZfWegDcbXnvd/su/DAuUr64fPOqrFUGT9XmkNATIf0N15pAd46vUgOvAJ2xo1wgc66QF6xzQbbGzqyL38cVCEAbt51sZ4BRZXa6QhuJnuIv/qBXjlyhYiJHqwcaEjX1xH6z0SUAGulzvtsLhGUgWB+UGh8Bu1iIxw6Ymrd4OcyGdQqxT402S2mvE4hSgITnLepae1hyF2CYFFvRQuVOqCfgX99wi0A1vtllhS3LTqb42StgoGuufqrwGae7SpIVgdFOzxS3+1XQk6W7sS2QfG4SFbvQUhsOWRO+D51k/sKxWJC0PhP22GtOm/cEiH7FS62wrKLiEG1uxWvLbtg8wIDAQABoEswSQYJKoZIhvcNAQkOMTwwOjAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMAkGA1UdEwQCMAAwDQYJKoZIhvcNAQELBQADggEBAJS5h1xcZ8dW9hgF6BlcKvHhLsBKqAynIa0JnBQRpxtee+w8hjgmM3aULMBdthsgIVSkfgdG8Y7A0isjXhKr+rXSOLnAasSxcEFgUf9g17ssSPrcT5+9ZF4XTVtJPEV6h3d8hlnwySYn1WsEkN4lYenih/7rHGRKbVOxXs1C5IgSwHSVDxjeeppxbC1l85KLz6FZJFx1XyuZiKhTAfwkxlR8kjXbBBasm0hBL58LkBg1re5wMjFYnh2qAB41yxA7YOQm4aoThgkN6gd9TfPyL/gG6e1I/dwQFCKp0B1RiPx4IZmvT3dIGDslQv9FpxpdB91XPTMm3bXrpHZcG3XiQw0=\",\"cancellation_requested\":true,\"status\":\"inProgress\",\"status_details\":\"Pending certificate created. Certificate request is in progress. This may take some time based on the issuer provider. Please check again later.\",\"request_id\":\"cfd5b1300dc944dab29b6f79af9558e1\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '70b770e6-7cff-4cce-9676-fd1c72889d86', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:34 GMT', + connection: 'close', + 'content-length': '1310' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates/asyncCancelledDeletedCert/pending?api-version=2015-06-01') + .reply(404, "{\"error\":{\"code\":\"PendingCertificateNotFound\",\"message\":\"Pending certificate not found: asyncCancelledDeletedCert\"}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-length': '116', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '603d79ea-51e3-4a93-b63e-6664bc352773', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:35 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates/asyncCancelledDeletedCert/pending?api-version=2015-06-01') + .reply(404, "{\"error\":{\"code\":\"PendingCertificateNotFound\",\"message\":\"Pending certificate not found: asyncCancelledDeletedCert\"}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-length': '116', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '603d79ea-51e3-4a93-b63e-6664bc352773', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:35 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .delete('/certificates/asyncCancelledDeletedCert?api-version=2015-06-01') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/asyncCancelledDeletedCert/7d7c399e6bc04ac1805a9eef71c68131\",\"attributes\":{\"enabled\":true,\"nbf\":1471039112,\"exp\":1502575712,\"created\":1471039712,\"updated\":1471039712},\"policy\":{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/asyncCancelledDeletedCert/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=*.microsoft.com\",\"sans\":{},\"ekus\":[\"1.3.6.1.5.5.7.3.1\",\"1.3.6.1.5.5.7.3.2\"],\"key_usage\":[\"digitalSignature\",\"keyEncipherment\"],\"validity_months\":12,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"AutoRenew\"}}],\"issuer\":{\"name\":\"Self\"},\"attributes\":{\"enabled\":true,\"created\":1471039712,\"updated\":1471039712}}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '80d09652-61f4-4d19-be94-6b6e9bc9a2df', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:35 GMT', + connection: 'close', + 'content-length': '868' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .delete('/certificates/asyncCancelledDeletedCert?api-version=2015-06-01') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/asyncCancelledDeletedCert/7d7c399e6bc04ac1805a9eef71c68131\",\"attributes\":{\"enabled\":true,\"nbf\":1471039112,\"exp\":1502575712,\"created\":1471039712,\"updated\":1471039712},\"policy\":{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/asyncCancelledDeletedCert/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=*.microsoft.com\",\"sans\":{},\"ekus\":[\"1.3.6.1.5.5.7.3.1\",\"1.3.6.1.5.5.7.3.2\"],\"key_usage\":[\"digitalSignature\",\"keyEncipherment\"],\"validity_months\":12,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"AutoRenew\"}}],\"issuer\":{\"name\":\"Self\"},\"attributes\":{\"enabled\":true,\"created\":1471039712,\"updated\":1471039712}}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '80d09652-61f4-4d19-be94-6b6e9bc9a2df', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:35 GMT', + connection: 'close', + 'content-length': '868' }); + return result; }], +[function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.put('/certificates/contacts?api-version=2015-06-01', '*') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/contacts\",\"contacts\":[{\"email\":\"admin@contoso.com\",\"name\":\"John Doe\",\"phone\":\"1111111111\"},{\"email\":\"admin2@contoso.com\",\"name\":\"John Doe2\",\"phone\":\"2222222222\"}]}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '6ea20be7-05cf-467e-9c8d-d3e14c1232aa', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:36 GMT', + connection: 'close', + 'content-length': '224' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.put('/certificates/contacts?api-version=2015-06-01', '*') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/contacts\",\"contacts\":[{\"email\":\"admin@contoso.com\",\"name\":\"John Doe\",\"phone\":\"1111111111\"},{\"email\":\"admin2@contoso.com\",\"name\":\"John Doe2\",\"phone\":\"2222222222\"}]}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '6ea20be7-05cf-467e-9c8d-d3e14c1232aa', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:36 GMT', + connection: 'close', + 'content-length': '224' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates/contacts?api-version=2015-06-01') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/contacts\",\"contacts\":[{\"email\":\"admin@contoso.com\",\"name\":\"John Doe\",\"phone\":\"1111111111\"},{\"email\":\"admin2@contoso.com\",\"name\":\"John Doe2\",\"phone\":\"2222222222\"}]}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '8eac6217-aea7-43fb-8145-9e03b25bbf51', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:36 GMT', + connection: 'close', + 'content-length': '224' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates/contacts?api-version=2015-06-01') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/contacts\",\"contacts\":[{\"email\":\"admin@contoso.com\",\"name\":\"John Doe\",\"phone\":\"1111111111\"},{\"email\":\"admin2@contoso.com\",\"name\":\"John Doe2\",\"phone\":\"2222222222\"}]}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '8eac6217-aea7-43fb-8145-9e03b25bbf51', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:36 GMT', + connection: 'close', + 'content-length': '224' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .delete('/certificates/contacts?api-version=2015-06-01') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/contacts\",\"contacts\":[{\"email\":\"admin@contoso.com\",\"name\":\"John Doe\",\"phone\":\"1111111111\"},{\"email\":\"admin2@contoso.com\",\"name\":\"John Doe2\",\"phone\":\"2222222222\"}]}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'b593f942-3778-4cb6-9c6f-8e26fb0e88d4', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:37 GMT', + connection: 'close', + 'content-length': '224' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .delete('/certificates/contacts?api-version=2015-06-01') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/contacts\",\"contacts\":[{\"email\":\"admin@contoso.com\",\"name\":\"John Doe\",\"phone\":\"1111111111\"},{\"email\":\"admin2@contoso.com\",\"name\":\"John Doe2\",\"phone\":\"2222222222\"}]}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'b593f942-3778-4cb6-9c6f-8e26fb0e88d4', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:37 GMT', + connection: 'close', + 'content-length': '224' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates/contacts?api-version=2015-06-01') + .reply(404, "{\"error\":{\"code\":\"ContactsNotFound\",\"message\":\"Contacts not found\"}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-length': '68', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '26a46dee-9d32-4ab6-9360-9d82aa0879ab', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:37 GMT', + connection: 'close' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates/contacts?api-version=2015-06-01') + .reply(404, "{\"error\":{\"code\":\"ContactsNotFound\",\"message\":\"Contacts not found\"}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-length': '68', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '26a46dee-9d32-4ab6-9360-9d82aa0879ab', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:37 GMT', + connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.post('/certificates/policyCertificate/import?api-version=2015-06-01', '*') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/policyCertificate/646ce4c6bf864d3596349fc8252b8ce2\",\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/policyCertificate/646ce4c6bf864d3596349fc8252b8ce2\",\"sid\":\"https://sdktestvault0511.vault.azure.net/secrets/policyCertificate/646ce4c6bf864d3596349fc8252b8ce2\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"cer\":\"MIICODCCAeagAwIBAgIQqHmpBAv+CY9IJFoUhlbziTAJBgUrDgMCHQUAMBYxFDASBgNVBAMTC1Jvb3QgQWdlbmN5MB4XDTE1MDQyOTIxNTM0MVoXDTM5MTIzMTIzNTk1OVowFzEVMBMGA1UEAxMMS2V5VmF1bHRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bVAT73zr4+N4WVv2+SvTunAw08ksS4BrJW/nNliz3S9XuzMBMXvmYzU5HJ8TtEgluBiZZYd5qsMJD+OXHSNbsLdmMhni0jYX09h3XlC2VJw2sGKeYF+xEaavXm337aZZaZyjrFBrrUl51UePaN+kVFXNlBb3N3TYpqa7KokXenJQuR+i9Gv9a77c0UsSsDSryxppYhKK7HvTZCpKrhVtulF5iPMswWe9np3uggfMamyIsK/0L7X9w9B2qN7993RR0A00nOk4H6CnkuwO77dSsD0KJsk6FyAoZBzRXDZh9+d9R76zCL506NcQy/jl0lCiQYwsUX73PG5pxOh02OwKwIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAGqIjo2geVagzuzaZOe1ClGKhZeiCKfWAxklaGN+qlGUbVS4IN4V1lot3VKnzabasmkEHeNxPwLn1qvSD0cX9CE=\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471039717,\"updated\":1471039717},\"policy\":{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/policyCertificate/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1469572889,\"updated\":1471039717}}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '63f0a9f6-6a8d-4d02-b21c-e2d232ecc0ea', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:38 GMT', + connection: 'close', + 'content-length': '1794' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.post('/certificates/policyCertificate/import?api-version=2015-06-01', '*') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/policyCertificate/646ce4c6bf864d3596349fc8252b8ce2\",\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/policyCertificate/646ce4c6bf864d3596349fc8252b8ce2\",\"sid\":\"https://sdktestvault0511.vault.azure.net/secrets/policyCertificate/646ce4c6bf864d3596349fc8252b8ce2\",\"x5t\":\"fLi3U52HunIVNXubkEnf8tP6Wbo\",\"cer\":\"MIICODCCAeagAwIBAgIQqHmpBAv+CY9IJFoUhlbziTAJBgUrDgMCHQUAMBYxFDASBgNVBAMTC1Jvb3QgQWdlbmN5MB4XDTE1MDQyOTIxNTM0MVoXDTM5MTIzMTIzNTk1OVowFzEVMBMGA1UEAxMMS2V5VmF1bHRUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5bVAT73zr4+N4WVv2+SvTunAw08ksS4BrJW/nNliz3S9XuzMBMXvmYzU5HJ8TtEgluBiZZYd5qsMJD+OXHSNbsLdmMhni0jYX09h3XlC2VJw2sGKeYF+xEaavXm337aZZaZyjrFBrrUl51UePaN+kVFXNlBb3N3TYpqa7KokXenJQuR+i9Gv9a77c0UsSsDSryxppYhKK7HvTZCpKrhVtulF5iPMswWe9np3uggfMamyIsK/0L7X9w9B2qN7993RR0A00nOk4H6CnkuwO77dSsD0KJsk6FyAoZBzRXDZh9+d9R76zCL506NcQy/jl0lCiQYwsUX73PG5pxOh02OwKwIDAQABo0swSTBHBgNVHQEEQDA+gBAS5AktBh0dTwCNYSHcFmRjoRgwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3mCEAY3bACqAGSKEc+41KpcNfQwCQYFKw4DAh0FAANBAGqIjo2geVagzuzaZOe1ClGKhZeiCKfWAxklaGN+qlGUbVS4IN4V1lot3VKnzabasmkEHeNxPwLn1qvSD0cX9CE=\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1471039717,\"updated\":1471039717},\"policy\":{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/policyCertificate/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1469572889,\"updated\":1471039717}}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '63f0a9f6-6a8d-4d02-b21c-e2d232ecc0ea', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:38 GMT', + connection: 'close', + 'content-length': '1794' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates/policyCertificate/policy?api-version=2015-06-01') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/policyCertificate/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1469572889,\"updated\":1471039717}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'e603a058-118d-464e-9b3a-fc63d8e0173f', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:39 GMT', + connection: 'close', + 'content-length': '543' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates/policyCertificate/policy?api-version=2015-06-01') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/policyCertificate/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Unknown\"},\"attributes\":{\"enabled\":true,\"created\":1469572889,\"updated\":1471039717}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'e603a058-118d-464e-9b3a-fc63d8e0173f', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:39 GMT', + connection: 'close', + 'content-length': '543' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.patch('/certificates/policyCertificate/policy?api-version=2015-06-01', '*') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/policyCertificate/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Self\"},\"attributes\":{\"enabled\":true,\"created\":1469572889,\"updated\":1471039719}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '1dacbab5-42b4-4eef-928e-ce438d398fcd', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:39 GMT', + connection: 'close', + 'content-length': '540' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.patch('/certificates/policyCertificate/policy?api-version=2015-06-01', '*') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/policyCertificate/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Self\"},\"attributes\":{\"enabled\":true,\"created\":1469572889,\"updated\":1471039719}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '1dacbab5-42b4-4eef-928e-ce438d398fcd', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:39 GMT', + connection: 'close', + 'content-length': '540' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates/policyCertificate/policy?api-version=2015-06-01') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/policyCertificate/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Self\"},\"attributes\":{\"enabled\":true,\"created\":1469572889,\"updated\":1471039719}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '1f30b0a3-2e05-44a6-a0ac-222ed106773f', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:39 GMT', + connection: 'close', + 'content-length': '540' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates/policyCertificate/policy?api-version=2015-06-01') + .reply(200, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/policyCertificate/policy\",\"key_props\":{\"exportable\":true,\"kty\":\"RSA\",\"key_size\":2048,\"reuse_key\":false},\"secret_props\":{\"contentType\":\"application/x-pkcs12\"},\"x509_props\":{\"subject\":\"CN=KeyVaultTest\",\"ekus\":[],\"key_usage\":[],\"validity_months\":297,\"basic_constraints\":{\"ca\":false}},\"lifetime_actions\":[{\"trigger\":{\"lifetime_percentage\":80},\"action\":{\"action_type\":\"EmailContacts\"}}],\"issuer\":{\"name\":\"Self\"},\"attributes\":{\"enabled\":true,\"created\":1469572889,\"updated\":1471039719}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '1f30b0a3-2e05-44a6-a0ac-222ed106773f', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:39 GMT', + connection: 'close', + 'content-length': '540' }); + return result; }], +[function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.post('/certificates/UnknownIssuerCert1/create?api-version=2015-06-01', '*') + .reply(202, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/UnknownIssuerCert1/pending\",\"issuer\":{\"name\":\"Unknown\"},\"csr\":\"MIICqjCCAZICAQAwGjEYMBYGA1UEAwwPKi5taWNyb3NvZnQuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsvn/m9mRRIAsxlw5/XxnhMm3YwCs6AA1jZupxKo1MgqK0XGxGNYlgNBT05aN+ISuMq7yutYLQbZLBsNlka4m7ON/GvySczPQOMf0nX1l/LKUKgHjCmOY25Lt2nALBZF3GMtRBbg/l+0yT5oFsjYgBgT2W0ihw2vI4t/bOaGU5RwI7U3j4ST3NS8/3YoVvwoOCIL+w90r9O7Y0sERNnKN+GtJvofn/6YH0U1F/eD6nXdrznvq7fM+N0UR7MemUAQodVX07wEUOxYUQNsp6YEciD/Bvs9mWttf7p/D3acHlwBZNHMLFrT8Q/X7bEFPQCAaeB396+iSmcvAauM65uAztQIDAQABoEswSQYJKoZIhvcNAQkOMTwwOjAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMAkGA1UdEwQCMAAwDQYJKoZIhvcNAQELBQADggEBAHkk0kd3mepNtoCkD5v10amQcpyx8DirTNug6c7GkAJXo/m6zC8zUh7O2E2Z+FXgkC4MMjsOPxYTfhaZ05kyKPkjFfAU685KF2Mt+ZTMf9ujzX9tFD6WhiOlMXQkxpSOuV/UQQtpcVMvRHgT5+FRq4BzE0Mb0obms5v/kEufALIMO/MVC569peu/qJCVOiTRXEIAOKFJNEnL5jVB3PWqKRRADQ+LeRg9AhHZM6IjcC5PUiN3N1+zjNNiuF17fV1YH48neK+7acv3/BHN1klQpeTFZsY4Lkkru9nXYd3PwlLHTThV16qap4+0U/CWglLF9H85Ea66MUMcpcD2Gh0q+qE=\",\"cancellation_requested\":false,\"status\":\"inProgress\",\"status_details\":\"Pending certificate created. Please Perform Merge to complete the request.\",\"request_id\":\"7a853569fc6c43ad9888b31f8fe74792\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + location: 'https://sdktestvault0511.vault.azure.net/certificates/UnknownIssuerCert1/pending?api-version=2015-06-01&request_id=7a853569fc6c43ad9888b31f8fe74792', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '71bd290b-6ca7-4cd8-9ed6-65f62a8255a2', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:40 GMT', + connection: 'close', + 'content-length': '1237' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.post('/certificates/UnknownIssuerCert1/create?api-version=2015-06-01', '*') + .reply(202, "{\"id\":\"https://sdktestvault0511.vault.azure.net/certificates/UnknownIssuerCert1/pending\",\"issuer\":{\"name\":\"Unknown\"},\"csr\":\"MIICqjCCAZICAQAwGjEYMBYGA1UEAwwPKi5taWNyb3NvZnQuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsvn/m9mRRIAsxlw5/XxnhMm3YwCs6AA1jZupxKo1MgqK0XGxGNYlgNBT05aN+ISuMq7yutYLQbZLBsNlka4m7ON/GvySczPQOMf0nX1l/LKUKgHjCmOY25Lt2nALBZF3GMtRBbg/l+0yT5oFsjYgBgT2W0ihw2vI4t/bOaGU5RwI7U3j4ST3NS8/3YoVvwoOCIL+w90r9O7Y0sERNnKN+GtJvofn/6YH0U1F/eD6nXdrznvq7fM+N0UR7MemUAQodVX07wEUOxYUQNsp6YEciD/Bvs9mWttf7p/D3acHlwBZNHMLFrT8Q/X7bEFPQCAaeB396+iSmcvAauM65uAztQIDAQABoEswSQYJKoZIhvcNAQkOMTwwOjAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMAkGA1UdEwQCMAAwDQYJKoZIhvcNAQELBQADggEBAHkk0kd3mepNtoCkD5v10amQcpyx8DirTNug6c7GkAJXo/m6zC8zUh7O2E2Z+FXgkC4MMjsOPxYTfhaZ05kyKPkjFfAU685KF2Mt+ZTMf9ujzX9tFD6WhiOlMXQkxpSOuV/UQQtpcVMvRHgT5+FRq4BzE0Mb0obms5v/kEufALIMO/MVC569peu/qJCVOiTRXEIAOKFJNEnL5jVB3PWqKRRADQ+LeRg9AhHZM6IjcC5PUiN3N1+zjNNiuF17fV1YH48neK+7acv3/BHN1klQpeTFZsY4Lkkru9nXYd3PwlLHTThV16qap4+0U/CWglLF9H85Ea66MUMcpcD2Gh0q+qE=\",\"cancellation_requested\":false,\"status\":\"inProgress\",\"status_details\":\"Pending certificate created. Please Perform Merge to complete the request.\",\"request_id\":\"7a853569fc6c43ad9888b31f8fe74792\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + location: 'https://sdktestvault0511.vault.azure.net/certificates/UnknownIssuerCert1/pending?api-version=2015-06-01&request_id=7a853569fc6c43ad9888b31f8fe74792', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '71bd290b-6ca7-4cd8-9ed6-65f62a8255a2', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:40 GMT', + connection: 'close', + 'content-length': '1237' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/certificates/UnknownIssuerCert1/pending?api-version=2015-06-01') + .reply(200, "MIICqjCCAZICAQAwGjEYMBYGA1UEAwwPKi5taWNyb3NvZnQuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsvn/m9mRRIAsxlw5/XxnhMm3YwCs6AA1jZupxKo1MgqK0XGxGNYlgNBT05aN+ISuMq7yutYLQbZLBsNlka4m7ON/GvySczPQOMf0nX1l/LKUKgHjCmOY25Lt2nALBZF3GMtRBbg/l+0yT5oFsjYgBgT2W0ihw2vI4t/bOaGU5RwI7U3j4ST3NS8/3YoVvwoOCIL+w90r9O7Y0sERNnKN+GtJvofn/6YH0U1F/eD6nXdrznvq7fM+N0UR7MemUAQodVX07wEUOxYUQNsp6YEciD/Bvs9mWttf7p/D3acHlwBZNHMLFrT8Q/X7bEFPQCAaeB396+iSmcvAauM65uAztQIDAQABoEswSQYJKoZIhvcNAQkOMTwwOjAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMAkGA1UdEwQCMAAwDQYJKoZIhvcNAQELBQADggEBAHkk0kd3mepNtoCkD5v10amQcpyx8DirTNug6c7GkAJXo/m6zC8zUh7O2E2Z+FXgkC4MMjsOPxYTfhaZ05kyKPkjFfAU685KF2Mt+ZTMf9ujzX9tFD6WhiOlMXQkxpSOuV/UQQtpcVMvRHgT5+FRq4BzE0Mb0obms5v/kEufALIMO/MVC569peu/qJCVOiTRXEIAOKFJNEnL5jVB3PWqKRRADQ+LeRg9AhHZM6IjcC5PUiN3N1+zjNNiuF17fV1YH48neK+7acv3/BHN1klQpeTFZsY4Lkkru9nXYd3PwlLHTThV16qap4+0U/CWglLF9H85Ea66MUMcpcD2Gh0q+qE=", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/pkcs10; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'fe2a5680-ca12-4ee5-b907-f3b316d2bc8e', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:41 GMT', + connection: 'close', + 'content-length': '916' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/certificates/UnknownIssuerCert1/pending?api-version=2015-06-01') + .reply(200, "MIICqjCCAZICAQAwGjEYMBYGA1UEAwwPKi5taWNyb3NvZnQuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsvn/m9mRRIAsxlw5/XxnhMm3YwCs6AA1jZupxKo1MgqK0XGxGNYlgNBT05aN+ISuMq7yutYLQbZLBsNlka4m7ON/GvySczPQOMf0nX1l/LKUKgHjCmOY25Lt2nALBZF3GMtRBbg/l+0yT5oFsjYgBgT2W0ihw2vI4t/bOaGU5RwI7U3j4ST3NS8/3YoVvwoOCIL+w90r9O7Y0sERNnKN+GtJvofn/6YH0U1F/eD6nXdrznvq7fM+N0UR7MemUAQodVX07wEUOxYUQNsp6YEciD/Bvs9mWttf7p/D3acHlwBZNHMLFrT8Q/X7bEFPQCAaeB396+iSmcvAauM65uAztQIDAQABoEswSQYJKoZIhvcNAQkOMTwwOjAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMAkGA1UdEwQCMAAwDQYJKoZIhvcNAQELBQADggEBAHkk0kd3mepNtoCkD5v10amQcpyx8DirTNug6c7GkAJXo/m6zC8zUh7O2E2Z+FXgkC4MMjsOPxYTfhaZ05kyKPkjFfAU685KF2Mt+ZTMf9ujzX9tFD6WhiOlMXQkxpSOuV/UQQtpcVMvRHgT5+FRq4BzE0Mb0obms5v/kEufALIMO/MVC569peu/qJCVOiTRXEIAOKFJNEnL5jVB3PWqKRRADQ+LeRg9AhHZM6IjcC5PUiN3N1+zjNNiuF17fV1YH48neK+7acv3/BHN1klQpeTFZsY4Lkkru9nXYd3PwlLHTThV16qap4+0U/CWglLF9H85Ea66MUMcpcD2Gh0q+qE=", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/pkcs10; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'fe2a5680-ca12-4ee5-b907-f3b316d2bc8e', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Fri, 12 Aug 2016 22:08:41 GMT', + connection: 'close', + 'content-length': '916' }); + return result; }]]; \ No newline at end of file diff --git a/test/recordings/keyVault-key-tests.nock.js b/test/recordings/keyVault-key-tests.nock.js index 8b35b3f41..851ac6def 100644 --- a/test/recordings/keyVault-key-tests.nock.js +++ b/test/recordings/keyVault-key-tests.nock.js @@ -3,1011 +3,1689 @@ exports.scopes = [[], [function (nock) { var result = -nock('http://nodesdktest.vault.azure.net:443') +nock('http://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) .post('/keys/nodeKey/create?api-version=2015-06-01', '*') - .reply(401, "", { 'cache-control': 'no-cache', - pragma: 'no-cache', - expires: '-1', - server: 'Microsoft-IIS/8.5', - 'www-authenticate': 'Bearer authorization="https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47", resource="https://vault.azure.net"', - 'x-ms-keyvault-service-version': '1.0.0.103', - 'x-aspnet-version': '4.0.30319', - 'x-powered-by': 'ASP.NET', - 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 22:59:49 GMT', - connection: 'close', - 'content-length': '0' }); - return result; }, -function (nock) { -var result = -nock('https://nodesdktest.vault.azure.net:443') - .filteringRequestBody(function (path) { return '*';}) -.post('/keys/nodeKey/create?api-version=2015-06-01', '*') - .reply(401, "", { 'cache-control': 'no-cache', - pragma: 'no-cache', - expires: '-1', - server: 'Microsoft-IIS/8.5', - 'www-authenticate': 'Bearer authorization="https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47", resource="https://vault.azure.net"', - 'x-ms-keyvault-service-version': '1.0.0.103', - 'x-aspnet-version': '4.0.30319', - 'x-powered-by': 'ASP.NET', - 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 22:59:49 GMT', - connection: 'close', - 'content-length': '0' }); - return result; }, -function (nock) { -var result = -nock('http://login.windows.net:443') - .filteringRequestBody(function (path) { return '*';}) -.post('/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/token', '*') - .reply(200, {"expires_in":"3600","token_type":"Bearer","expires_on":"1438732790","not_before":"1438728890","resource":"https://vault.azure.net","access_token":"goobledygoop"}, { 'cache-control': 'no-cache, no-store', + .reply(200, "{\"key\":{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/82a87ff5b7674935bbb0d6a7d4cf341a\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"oG5TeCVVRYmyoE9OQDEJYmqMKcksLcpNuX0XA2GZTB2jdzVbOiSw0tC8lISngYSJ1UFPpsp2sHSHPshuxpL_AI4GF8yMCtdTI-uOWGJdADi46dg-Mq4w_6oJD_ssl58ZUYMR1VRne2HOMQPwM2BzdiKWnGfrE4tdgSOC6eiLZT0IEBObm8zPOPRudKpm79M69n_xSnVJE2vJd0D0_7cdUrMREqpVNn6A4o3190_ot7KM9xv3yswuXktbJL42X9chFamAbKtbW8M4bRtIT-OQMTjWG7m1tY38pncUK3eRYhXReUkm3FRFbq406FxdtXGAn5kMuDofbOH9k-n5ql1Tyw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1470959463,\"updated\":1470959463}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-request-id': '4498e76c-dd98-476b-b032-818babf9169d', - 'client-request-id': '51a7b8a0-68d8-42ec-9ba2-bdec7d319aac', - 'x-ms-gateway-service-instanceid': 'ESTSFE_IN_130', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '060f131e-a952-4cc8-8a43-c1d561b732e8', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', 'x-content-type-options': 'nosniff', - 'strict-transport-security': 'max-age=31536000; includeSubDomains', - p3p: 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'set-cookie': - [ 'x-ms-gateway-slice=productionb; path=/; secure; HttpOnly', - 'stsservicecookie=ests; path=/; secure; HttpOnly' ], - 'x-powered-by': 'ASP.NET', - date: 'Tue, 04 Aug 2015 22:59:49 GMT', + date: 'Thu, 11 Aug 2016 23:51:03 GMT', connection: 'close', - 'content-length': '1204' }); + 'content-length': '618' }); return result; }, function (nock) { var result = -nock('https://login.windows.net:443') +nock('https://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) -.post('/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/token', '*') - .reply(200, {"expires_in":"3600","token_type":"Bearer","expires_on":"1438732790","not_before":"1438728890","resource":"https://vault.azure.net","access_token":"goobledygoop"}, { 'cache-control': 'no-cache, no-store', +.post('/keys/nodeKey/create?api-version=2015-06-01', '*') + .reply(200, "{\"key\":{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/82a87ff5b7674935bbb0d6a7d4cf341a\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"oG5TeCVVRYmyoE9OQDEJYmqMKcksLcpNuX0XA2GZTB2jdzVbOiSw0tC8lISngYSJ1UFPpsp2sHSHPshuxpL_AI4GF8yMCtdTI-uOWGJdADi46dg-Mq4w_6oJD_ssl58ZUYMR1VRne2HOMQPwM2BzdiKWnGfrE4tdgSOC6eiLZT0IEBObm8zPOPRudKpm79M69n_xSnVJE2vJd0D0_7cdUrMREqpVNn6A4o3190_ot7KM9xv3yswuXktbJL42X9chFamAbKtbW8M4bRtIT-OQMTjWG7m1tY38pncUK3eRYhXReUkm3FRFbq406FxdtXGAn5kMuDofbOH9k-n5ql1Tyw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1470959463,\"updated\":1470959463}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-request-id': '4498e76c-dd98-476b-b032-818babf9169d', - 'client-request-id': '51a7b8a0-68d8-42ec-9ba2-bdec7d319aac', - 'x-ms-gateway-service-instanceid': 'ESTSFE_IN_130', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '060f131e-a952-4cc8-8a43-c1d561b732e8', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', 'x-content-type-options': 'nosniff', - 'strict-transport-security': 'max-age=31536000; includeSubDomains', - p3p: 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'set-cookie': - [ 'x-ms-gateway-slice=productionb; path=/; secure; HttpOnly', - 'stsservicecookie=ests; path=/; secure; HttpOnly' ], - 'x-powered-by': 'ASP.NET', - date: 'Tue, 04 Aug 2015 22:59:49 GMT', + date: 'Thu, 11 Aug 2016 23:51:03 GMT', connection: 'close', - 'content-length': '1204' }); + 'content-length': '618' }); return result; }, function (nock) { var result = -nock('http://nodesdktest.vault.azure.net:443') - .filteringRequestBody(function (path) { return '*';}) -.post('/keys/nodeKey/create?api-version=2015-06-01', '*') - .reply(200, {"key":{"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/8279d9cedf584a14ab769f6e4cad3c37","kty":"RSA","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"myOiQOik-mWM3lXHAabYZ91ghOrPLaN5v56ewVeK4t-lzITS4irAJkF02gvNqt0HD9UPpPfzrLry5WaQiPa46SV56ZNVmQBXnS8Xk6Z6RF9tV_dLupUKXrtAwdSm3CcPFuUujC2Y-hPVIAKGNec2VmqrxbnOmunZ4AuOXDMuGqv1kPGKSfy8umoLHjYu0ejiZkJnhEj_5NNm1dxMm-wBS-vbxTNi8MkNO5n9DGZ5Ohek2XNfMEFeREtEnWta8xjSqM2saPh4Mq6N7HOIzKl8j7MkCQ3viE_PqlYBYq7nGyoRI3Lr21SUPTInOK8GRvQqHdx2-848ZQXj3-JI-SDiSw","e":"AQAB"},"attributes":{"enabled":true,"created":1438729190,"updated":1438729190}}, { 'cache-control': 'no-cache', - pragma: 'no-cache', - 'content-type': 'application/json; charset=utf-8', - expires: '-1', - server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', - 'x-aspnet-version': '4.0.30319', - 'x-powered-by': 'ASP.NET', - 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 22:59:50 GMT', - connection: 'close', - 'content-length': '617' }); - return result; }, -function (nock) { -var result = -nock('https://nodesdktest.vault.azure.net:443') - .filteringRequestBody(function (path) { return '*';}) -.post('/keys/nodeKey/create?api-version=2015-06-01', '*') - .reply(200, {"key":{"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/8279d9cedf584a14ab769f6e4cad3c37","kty":"RSA","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"myOiQOik-mWM3lXHAabYZ91ghOrPLaN5v56ewVeK4t-lzITS4irAJkF02gvNqt0HD9UPpPfzrLry5WaQiPa46SV56ZNVmQBXnS8Xk6Z6RF9tV_dLupUKXrtAwdSm3CcPFuUujC2Y-hPVIAKGNec2VmqrxbnOmunZ4AuOXDMuGqv1kPGKSfy8umoLHjYu0ejiZkJnhEj_5NNm1dxMm-wBS-vbxTNi8MkNO5n9DGZ5Ohek2XNfMEFeREtEnWta8xjSqM2saPh4Mq6N7HOIzKl8j7MkCQ3viE_PqlYBYq7nGyoRI3Lr21SUPTInOK8GRvQqHdx2-848ZQXj3-JI-SDiSw","e":"AQAB"},"attributes":{"enabled":true,"created":1438729190,"updated":1438729190}}, { 'cache-control': 'no-cache', - pragma: 'no-cache', - 'content-type': 'application/json; charset=utf-8', - expires: '-1', - server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', - 'x-aspnet-version': '4.0.30319', - 'x-powered-by': 'ASP.NET', - 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 22:59:50 GMT', - connection: 'close', - 'content-length': '617' }); - return result; }, -function (nock) { -var result = -nock('http://nodesdktest.vault.azure.net:443') +nock('http://sdktestvault0511.vault.azure.net') .get('/keys/nodeKey/?api-version=2015-06-01') - .reply(200, {"key":{"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/8279d9cedf584a14ab769f6e4cad3c37","kty":"RSA","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"myOiQOik-mWM3lXHAabYZ91ghOrPLaN5v56ewVeK4t-lzITS4irAJkF02gvNqt0HD9UPpPfzrLry5WaQiPa46SV56ZNVmQBXnS8Xk6Z6RF9tV_dLupUKXrtAwdSm3CcPFuUujC2Y-hPVIAKGNec2VmqrxbnOmunZ4AuOXDMuGqv1kPGKSfy8umoLHjYu0ejiZkJnhEj_5NNm1dxMm-wBS-vbxTNi8MkNO5n9DGZ5Ohek2XNfMEFeREtEnWta8xjSqM2saPh4Mq6N7HOIzKl8j7MkCQ3viE_PqlYBYq7nGyoRI3Lr21SUPTInOK8GRvQqHdx2-848ZQXj3-JI-SDiSw","e":"AQAB"},"attributes":{"enabled":true,"created":1438729190,"updated":1438729190}}, { 'cache-control': 'no-cache', + .reply(200, "{\"key\":{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/82a87ff5b7674935bbb0d6a7d4cf341a\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"oG5TeCVVRYmyoE9OQDEJYmqMKcksLcpNuX0XA2GZTB2jdzVbOiSw0tC8lISngYSJ1UFPpsp2sHSHPshuxpL_AI4GF8yMCtdTI-uOWGJdADi46dg-Mq4w_6oJD_ssl58ZUYMR1VRne2HOMQPwM2BzdiKWnGfrE4tdgSOC6eiLZT0IEBObm8zPOPRudKpm79M69n_xSnVJE2vJd0D0_7cdUrMREqpVNn6A4o3190_ot7KM9xv3yswuXktbJL42X9chFamAbKtbW8M4bRtIT-OQMTjWG7m1tY38pncUK3eRYhXReUkm3FRFbq406FxdtXGAn5kMuDofbOH9k-n5ql1Tyw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1470959463,\"updated\":1470959463}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '731290d9-ec6b-4017-ad0b-b82d673dfbec', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 22:59:50 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:04 GMT', connection: 'close', - 'content-length': '617' }); + 'content-length': '618' }); return result; }, function (nock) { var result = -nock('https://nodesdktest.vault.azure.net:443') +nock('https://sdktestvault0511.vault.azure.net') .get('/keys/nodeKey/?api-version=2015-06-01') - .reply(200, {"key":{"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/8279d9cedf584a14ab769f6e4cad3c37","kty":"RSA","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"myOiQOik-mWM3lXHAabYZ91ghOrPLaN5v56ewVeK4t-lzITS4irAJkF02gvNqt0HD9UPpPfzrLry5WaQiPa46SV56ZNVmQBXnS8Xk6Z6RF9tV_dLupUKXrtAwdSm3CcPFuUujC2Y-hPVIAKGNec2VmqrxbnOmunZ4AuOXDMuGqv1kPGKSfy8umoLHjYu0ejiZkJnhEj_5NNm1dxMm-wBS-vbxTNi8MkNO5n9DGZ5Ohek2XNfMEFeREtEnWta8xjSqM2saPh4Mq6N7HOIzKl8j7MkCQ3viE_PqlYBYq7nGyoRI3Lr21SUPTInOK8GRvQqHdx2-848ZQXj3-JI-SDiSw","e":"AQAB"},"attributes":{"enabled":true,"created":1438729190,"updated":1438729190}}, { 'cache-control': 'no-cache', + .reply(200, "{\"key\":{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/82a87ff5b7674935bbb0d6a7d4cf341a\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"oG5TeCVVRYmyoE9OQDEJYmqMKcksLcpNuX0XA2GZTB2jdzVbOiSw0tC8lISngYSJ1UFPpsp2sHSHPshuxpL_AI4GF8yMCtdTI-uOWGJdADi46dg-Mq4w_6oJD_ssl58ZUYMR1VRne2HOMQPwM2BzdiKWnGfrE4tdgSOC6eiLZT0IEBObm8zPOPRudKpm79M69n_xSnVJE2vJd0D0_7cdUrMREqpVNn6A4o3190_ot7KM9xv3yswuXktbJL42X9chFamAbKtbW8M4bRtIT-OQMTjWG7m1tY38pncUK3eRYhXReUkm3FRFbq406FxdtXGAn5kMuDofbOH9k-n5ql1Tyw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1470959463,\"updated\":1470959463}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '731290d9-ec6b-4017-ad0b-b82d673dfbec', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 22:59:50 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:04 GMT', connection: 'close', - 'content-length': '617' }); + 'content-length': '618' }); return result; }, function (nock) { var result = -nock('http://nodesdktest.vault.azure.net:443') - .get('/keys/nodeKey/8279d9cedf584a14ab769f6e4cad3c37/?api-version=2015-06-01') - .reply(200, {"key":{"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/8279d9cedf584a14ab769f6e4cad3c37","kty":"RSA","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"myOiQOik-mWM3lXHAabYZ91ghOrPLaN5v56ewVeK4t-lzITS4irAJkF02gvNqt0HD9UPpPfzrLry5WaQiPa46SV56ZNVmQBXnS8Xk6Z6RF9tV_dLupUKXrtAwdSm3CcPFuUujC2Y-hPVIAKGNec2VmqrxbnOmunZ4AuOXDMuGqv1kPGKSfy8umoLHjYu0ejiZkJnhEj_5NNm1dxMm-wBS-vbxTNi8MkNO5n9DGZ5Ohek2XNfMEFeREtEnWta8xjSqM2saPh4Mq6N7HOIzKl8j7MkCQ3viE_PqlYBYq7nGyoRI3Lr21SUPTInOK8GRvQqHdx2-848ZQXj3-JI-SDiSw","e":"AQAB"},"attributes":{"enabled":true,"created":1438729190,"updated":1438729190}}, { 'cache-control': 'no-cache', +nock('http://sdktestvault0511.vault.azure.net') + .get('/keys/nodeKey/82a87ff5b7674935bbb0d6a7d4cf341a?api-version=2015-06-01') + .reply(200, "{\"key\":{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/82a87ff5b7674935bbb0d6a7d4cf341a\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"oG5TeCVVRYmyoE9OQDEJYmqMKcksLcpNuX0XA2GZTB2jdzVbOiSw0tC8lISngYSJ1UFPpsp2sHSHPshuxpL_AI4GF8yMCtdTI-uOWGJdADi46dg-Mq4w_6oJD_ssl58ZUYMR1VRne2HOMQPwM2BzdiKWnGfrE4tdgSOC6eiLZT0IEBObm8zPOPRudKpm79M69n_xSnVJE2vJd0D0_7cdUrMREqpVNn6A4o3190_ot7KM9xv3yswuXktbJL42X9chFamAbKtbW8M4bRtIT-OQMTjWG7m1tY38pncUK3eRYhXReUkm3FRFbq406FxdtXGAn5kMuDofbOH9k-n5ql1Tyw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1470959463,\"updated\":1470959463}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'e7a552a8-a8ac-4865-8af7-efb8803e2f0f', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 22:59:51 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:04 GMT', connection: 'close', - 'content-length': '617' }); + 'content-length': '618' }); return result; }, function (nock) { var result = -nock('https://nodesdktest.vault.azure.net:443') - .get('/keys/nodeKey/8279d9cedf584a14ab769f6e4cad3c37/?api-version=2015-06-01') - .reply(200, {"key":{"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/8279d9cedf584a14ab769f6e4cad3c37","kty":"RSA","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"myOiQOik-mWM3lXHAabYZ91ghOrPLaN5v56ewVeK4t-lzITS4irAJkF02gvNqt0HD9UPpPfzrLry5WaQiPa46SV56ZNVmQBXnS8Xk6Z6RF9tV_dLupUKXrtAwdSm3CcPFuUujC2Y-hPVIAKGNec2VmqrxbnOmunZ4AuOXDMuGqv1kPGKSfy8umoLHjYu0ejiZkJnhEj_5NNm1dxMm-wBS-vbxTNi8MkNO5n9DGZ5Ohek2XNfMEFeREtEnWta8xjSqM2saPh4Mq6N7HOIzKl8j7MkCQ3viE_PqlYBYq7nGyoRI3Lr21SUPTInOK8GRvQqHdx2-848ZQXj3-JI-SDiSw","e":"AQAB"},"attributes":{"enabled":true,"created":1438729190,"updated":1438729190}}, { 'cache-control': 'no-cache', +nock('https://sdktestvault0511.vault.azure.net') + .get('/keys/nodeKey/82a87ff5b7674935bbb0d6a7d4cf341a?api-version=2015-06-01') + .reply(200, "{\"key\":{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/82a87ff5b7674935bbb0d6a7d4cf341a\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"oG5TeCVVRYmyoE9OQDEJYmqMKcksLcpNuX0XA2GZTB2jdzVbOiSw0tC8lISngYSJ1UFPpsp2sHSHPshuxpL_AI4GF8yMCtdTI-uOWGJdADi46dg-Mq4w_6oJD_ssl58ZUYMR1VRne2HOMQPwM2BzdiKWnGfrE4tdgSOC6eiLZT0IEBObm8zPOPRudKpm79M69n_xSnVJE2vJd0D0_7cdUrMREqpVNn6A4o3190_ot7KM9xv3yswuXktbJL42X9chFamAbKtbW8M4bRtIT-OQMTjWG7m1tY38pncUK3eRYhXReUkm3FRFbq406FxdtXGAn5kMuDofbOH9k-n5ql1Tyw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1470959463,\"updated\":1470959463}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'e7a552a8-a8ac-4865-8af7-efb8803e2f0f', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 22:59:51 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:04 GMT', connection: 'close', - 'content-length': '617' }); + 'content-length': '618' }); return result; }, function (nock) { var result = -nock('http://nodesdktest.vault.azure.net:443') +nock('http://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) -.patch('/keys/nodeKey/update?api-version=2015-06-01', '*') - .reply(200, {"key":{"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/8279d9cedf584a14ab769f6e4cad3c37","kty":"RSA","key_ops":["encrypt","decrypt"],"n":"myOiQOik-mWM3lXHAabYZ91ghOrPLaN5v56ewVeK4t-lzITS4irAJkF02gvNqt0HD9UPpPfzrLry5WaQiPa46SV56ZNVmQBXnS8Xk6Z6RF9tV_dLupUKXrtAwdSm3CcPFuUujC2Y-hPVIAKGNec2VmqrxbnOmunZ4AuOXDMuGqv1kPGKSfy8umoLHjYu0ejiZkJnhEj_5NNm1dxMm-wBS-vbxTNi8MkNO5n9DGZ5Ohek2XNfMEFeREtEnWta8xjSqM2saPh4Mq6N7HOIzKl8j7MkCQ3viE_PqlYBYq7nGyoRI3Lr21SUPTInOK8GRvQqHdx2-848ZQXj3-JI-SDiSw","e":"AQAB"},"attributes":{"enabled":true,"exp":2527401600,"created":1438729190,"updated":1438729192},"tags":{"foo":"ede2c2613ab96101ef90e0f93ed400417324724f8d0793cc46156eb21c83a50b2aa6d24fbbdce46d3a06ef47b671ba579248"}}, { 'cache-control': 'no-cache', +.patch('/keys/nodeKey/?api-version=2015-06-01', '*') + .reply(200, "{\"key\":{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/82a87ff5b7674935bbb0d6a7d4cf341a\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\"],\"n\":\"oG5TeCVVRYmyoE9OQDEJYmqMKcksLcpNuX0XA2GZTB2jdzVbOiSw0tC8lISngYSJ1UFPpsp2sHSHPshuxpL_AI4GF8yMCtdTI-uOWGJdADi46dg-Mq4w_6oJD_ssl58ZUYMR1VRne2HOMQPwM2BzdiKWnGfrE4tdgSOC6eiLZT0IEBObm8zPOPRudKpm79M69n_xSnVJE2vJd0D0_7cdUrMREqpVNn6A4o3190_ot7KM9xv3yswuXktbJL42X9chFamAbKtbW8M4bRtIT-OQMTjWG7m1tY38pncUK3eRYhXReUkm3FRFbq406FxdtXGAn5kMuDofbOH9k-n5ql1Tyw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"exp\":2527401600,\"created\":1470959463,\"updated\":1470959466},\"tags\":{\"foo\":\"ede2c2613ab96101ef90e0f93ed400417324724f8d0793cc46156eb21c83a50b2aa6d24fbbdce46d3a06ef47b671ba579248\"}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '266cb143-a96f-4bdd-b2aa-a28590bde7de', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 22:59:52 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:06 GMT', connection: 'close', - 'content-length': '714' }); + 'content-length': '715' }); return result; }, function (nock) { var result = -nock('https://nodesdktest.vault.azure.net:443') +nock('https://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) -.patch('/keys/nodeKey/update?api-version=2015-06-01', '*') - .reply(200, {"key":{"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/8279d9cedf584a14ab769f6e4cad3c37","kty":"RSA","key_ops":["encrypt","decrypt"],"n":"myOiQOik-mWM3lXHAabYZ91ghOrPLaN5v56ewVeK4t-lzITS4irAJkF02gvNqt0HD9UPpPfzrLry5WaQiPa46SV56ZNVmQBXnS8Xk6Z6RF9tV_dLupUKXrtAwdSm3CcPFuUujC2Y-hPVIAKGNec2VmqrxbnOmunZ4AuOXDMuGqv1kPGKSfy8umoLHjYu0ejiZkJnhEj_5NNm1dxMm-wBS-vbxTNi8MkNO5n9DGZ5Ohek2XNfMEFeREtEnWta8xjSqM2saPh4Mq6N7HOIzKl8j7MkCQ3viE_PqlYBYq7nGyoRI3Lr21SUPTInOK8GRvQqHdx2-848ZQXj3-JI-SDiSw","e":"AQAB"},"attributes":{"enabled":true,"exp":2527401600,"created":1438729190,"updated":1438729192},"tags":{"foo":"ede2c2613ab96101ef90e0f93ed400417324724f8d0793cc46156eb21c83a50b2aa6d24fbbdce46d3a06ef47b671ba579248"}}, { 'cache-control': 'no-cache', +.patch('/keys/nodeKey/?api-version=2015-06-01', '*') + .reply(200, "{\"key\":{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/82a87ff5b7674935bbb0d6a7d4cf341a\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\"],\"n\":\"oG5TeCVVRYmyoE9OQDEJYmqMKcksLcpNuX0XA2GZTB2jdzVbOiSw0tC8lISngYSJ1UFPpsp2sHSHPshuxpL_AI4GF8yMCtdTI-uOWGJdADi46dg-Mq4w_6oJD_ssl58ZUYMR1VRne2HOMQPwM2BzdiKWnGfrE4tdgSOC6eiLZT0IEBObm8zPOPRudKpm79M69n_xSnVJE2vJd0D0_7cdUrMREqpVNn6A4o3190_ot7KM9xv3yswuXktbJL42X9chFamAbKtbW8M4bRtIT-OQMTjWG7m1tY38pncUK3eRYhXReUkm3FRFbq406FxdtXGAn5kMuDofbOH9k-n5ql1Tyw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"exp\":2527401600,\"created\":1470959463,\"updated\":1470959466},\"tags\":{\"foo\":\"ede2c2613ab96101ef90e0f93ed400417324724f8d0793cc46156eb21c83a50b2aa6d24fbbdce46d3a06ef47b671ba579248\"}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '266cb143-a96f-4bdd-b2aa-a28590bde7de', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 22:59:52 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:06 GMT', connection: 'close', - 'content-length': '714' }); + 'content-length': '715' }); return result; }, function (nock) { var result = -nock('http://nodesdktest.vault.azure.net:443') +nock('http://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) -.patch('/keys/nodeKey/8279d9cedf584a14ab769f6e4cad3c37/update?api-version=2015-06-01', '*') - .reply(200, {"key":{"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/8279d9cedf584a14ab769f6e4cad3c37","kty":"RSA","key_ops":["encrypt","decrypt"],"n":"myOiQOik-mWM3lXHAabYZ91ghOrPLaN5v56ewVeK4t-lzITS4irAJkF02gvNqt0HD9UPpPfzrLry5WaQiPa46SV56ZNVmQBXnS8Xk6Z6RF9tV_dLupUKXrtAwdSm3CcPFuUujC2Y-hPVIAKGNec2VmqrxbnOmunZ4AuOXDMuGqv1kPGKSfy8umoLHjYu0ejiZkJnhEj_5NNm1dxMm-wBS-vbxTNi8MkNO5n9DGZ5Ohek2XNfMEFeREtEnWta8xjSqM2saPh4Mq6N7HOIzKl8j7MkCQ3viE_PqlYBYq7nGyoRI3Lr21SUPTInOK8GRvQqHdx2-848ZQXj3-JI-SDiSw","e":"AQAB"},"attributes":{"enabled":true,"exp":2527401600,"created":1438729190,"updated":1438729192},"tags":{"foo":"1c2113c5908b1633b597923b338e697e6396c6b61dea3431fd058d6efb89d103d134e7d6c14ec3c37686dccf447009884afa"}}, { 'cache-control': 'no-cache', +.patch('/keys/nodeKey/82a87ff5b7674935bbb0d6a7d4cf341a?api-version=2015-06-01', '*') + .reply(200, "{\"key\":{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/82a87ff5b7674935bbb0d6a7d4cf341a\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\"],\"n\":\"oG5TeCVVRYmyoE9OQDEJYmqMKcksLcpNuX0XA2GZTB2jdzVbOiSw0tC8lISngYSJ1UFPpsp2sHSHPshuxpL_AI4GF8yMCtdTI-uOWGJdADi46dg-Mq4w_6oJD_ssl58ZUYMR1VRne2HOMQPwM2BzdiKWnGfrE4tdgSOC6eiLZT0IEBObm8zPOPRudKpm79M69n_xSnVJE2vJd0D0_7cdUrMREqpVNn6A4o3190_ot7KM9xv3yswuXktbJL42X9chFamAbKtbW8M4bRtIT-OQMTjWG7m1tY38pncUK3eRYhXReUkm3FRFbq406FxdtXGAn5kMuDofbOH9k-n5ql1Tyw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"exp\":2527401600,\"created\":1470959463,\"updated\":1470959467},\"tags\":{\"foo\":\"1c2113c5908b1633b597923b338e697e6396c6b61dea3431fd058d6efb89d103d134e7d6c14ec3c37686dccf447009884afa\"}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '9325c3c0-b861-4e6a-9dc3-0ffbe2d2e4bf', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 22:59:52 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:06 GMT', connection: 'close', - 'content-length': '714' }); + 'content-length': '715' }); return result; }, function (nock) { var result = -nock('https://nodesdktest.vault.azure.net:443') +nock('https://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) -.patch('/keys/nodeKey/8279d9cedf584a14ab769f6e4cad3c37/update?api-version=2015-06-01', '*') - .reply(200, {"key":{"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/8279d9cedf584a14ab769f6e4cad3c37","kty":"RSA","key_ops":["encrypt","decrypt"],"n":"myOiQOik-mWM3lXHAabYZ91ghOrPLaN5v56ewVeK4t-lzITS4irAJkF02gvNqt0HD9UPpPfzrLry5WaQiPa46SV56ZNVmQBXnS8Xk6Z6RF9tV_dLupUKXrtAwdSm3CcPFuUujC2Y-hPVIAKGNec2VmqrxbnOmunZ4AuOXDMuGqv1kPGKSfy8umoLHjYu0ejiZkJnhEj_5NNm1dxMm-wBS-vbxTNi8MkNO5n9DGZ5Ohek2XNfMEFeREtEnWta8xjSqM2saPh4Mq6N7HOIzKl8j7MkCQ3viE_PqlYBYq7nGyoRI3Lr21SUPTInOK8GRvQqHdx2-848ZQXj3-JI-SDiSw","e":"AQAB"},"attributes":{"enabled":true,"exp":2527401600,"created":1438729190,"updated":1438729192},"tags":{"foo":"1c2113c5908b1633b597923b338e697e6396c6b61dea3431fd058d6efb89d103d134e7d6c14ec3c37686dccf447009884afa"}}, { 'cache-control': 'no-cache', +.patch('/keys/nodeKey/82a87ff5b7674935bbb0d6a7d4cf341a?api-version=2015-06-01', '*') + .reply(200, "{\"key\":{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/82a87ff5b7674935bbb0d6a7d4cf341a\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\"],\"n\":\"oG5TeCVVRYmyoE9OQDEJYmqMKcksLcpNuX0XA2GZTB2jdzVbOiSw0tC8lISngYSJ1UFPpsp2sHSHPshuxpL_AI4GF8yMCtdTI-uOWGJdADi46dg-Mq4w_6oJD_ssl58ZUYMR1VRne2HOMQPwM2BzdiKWnGfrE4tdgSOC6eiLZT0IEBObm8zPOPRudKpm79M69n_xSnVJE2vJd0D0_7cdUrMREqpVNn6A4o3190_ot7KM9xv3yswuXktbJL42X9chFamAbKtbW8M4bRtIT-OQMTjWG7m1tY38pncUK3eRYhXReUkm3FRFbq406FxdtXGAn5kMuDofbOH9k-n5ql1Tyw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"exp\":2527401600,\"created\":1470959463,\"updated\":1470959467},\"tags\":{\"foo\":\"1c2113c5908b1633b597923b338e697e6396c6b61dea3431fd058d6efb89d103d134e7d6c14ec3c37686dccf447009884afa\"}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '9325c3c0-b861-4e6a-9dc3-0ffbe2d2e4bf', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 22:59:52 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:06 GMT', connection: 'close', - 'content-length': '714' }); + 'content-length': '715' }); return result; }, function (nock) { var result = -nock('http://nodesdktest.vault.azure.net:443') - .delete('/keys/nodeKey/delete?api-version=2015-06-01') - .reply(200, {"key":{"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/8279d9cedf584a14ab769f6e4cad3c37","kty":"RSA","key_ops":["encrypt","decrypt"],"n":"myOiQOik-mWM3lXHAabYZ91ghOrPLaN5v56ewVeK4t-lzITS4irAJkF02gvNqt0HD9UPpPfzrLry5WaQiPa46SV56ZNVmQBXnS8Xk6Z6RF9tV_dLupUKXrtAwdSm3CcPFuUujC2Y-hPVIAKGNec2VmqrxbnOmunZ4AuOXDMuGqv1kPGKSfy8umoLHjYu0ejiZkJnhEj_5NNm1dxMm-wBS-vbxTNi8MkNO5n9DGZ5Ohek2XNfMEFeREtEnWta8xjSqM2saPh4Mq6N7HOIzKl8j7MkCQ3viE_PqlYBYq7nGyoRI3Lr21SUPTInOK8GRvQqHdx2-848ZQXj3-JI-SDiSw","e":"AQAB"},"attributes":{"enabled":true,"exp":2527401600,"created":1438729190,"updated":1438729192},"tags":{"foo":"1c2113c5908b1633b597923b338e697e6396c6b61dea3431fd058d6efb89d103d134e7d6c14ec3c37686dccf447009884afa"}}, { 'cache-control': 'no-cache', +nock('http://sdktestvault0511.vault.azure.net') + .delete('/keys/nodeKey?api-version=2015-06-01') + .reply(200, "{\"key\":{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/82a87ff5b7674935bbb0d6a7d4cf341a\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\"],\"n\":\"oG5TeCVVRYmyoE9OQDEJYmqMKcksLcpNuX0XA2GZTB2jdzVbOiSw0tC8lISngYSJ1UFPpsp2sHSHPshuxpL_AI4GF8yMCtdTI-uOWGJdADi46dg-Mq4w_6oJD_ssl58ZUYMR1VRne2HOMQPwM2BzdiKWnGfrE4tdgSOC6eiLZT0IEBObm8zPOPRudKpm79M69n_xSnVJE2vJd0D0_7cdUrMREqpVNn6A4o3190_ot7KM9xv3yswuXktbJL42X9chFamAbKtbW8M4bRtIT-OQMTjWG7m1tY38pncUK3eRYhXReUkm3FRFbq406FxdtXGAn5kMuDofbOH9k-n5ql1Tyw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"exp\":2527401600,\"created\":1470959463,\"updated\":1470959467},\"tags\":{\"foo\":\"1c2113c5908b1633b597923b338e697e6396c6b61dea3431fd058d6efb89d103d134e7d6c14ec3c37686dccf447009884afa\"}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '4f0aad91-2b00-468a-b7dd-a642aefeadf8', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 22:59:52 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:07 GMT', connection: 'close', - 'content-length': '714' }); + 'content-length': '715' }); return result; }, function (nock) { var result = -nock('https://nodesdktest.vault.azure.net:443') - .delete('/keys/nodeKey/delete?api-version=2015-06-01') - .reply(200, {"key":{"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/8279d9cedf584a14ab769f6e4cad3c37","kty":"RSA","key_ops":["encrypt","decrypt"],"n":"myOiQOik-mWM3lXHAabYZ91ghOrPLaN5v56ewVeK4t-lzITS4irAJkF02gvNqt0HD9UPpPfzrLry5WaQiPa46SV56ZNVmQBXnS8Xk6Z6RF9tV_dLupUKXrtAwdSm3CcPFuUujC2Y-hPVIAKGNec2VmqrxbnOmunZ4AuOXDMuGqv1kPGKSfy8umoLHjYu0ejiZkJnhEj_5NNm1dxMm-wBS-vbxTNi8MkNO5n9DGZ5Ohek2XNfMEFeREtEnWta8xjSqM2saPh4Mq6N7HOIzKl8j7MkCQ3viE_PqlYBYq7nGyoRI3Lr21SUPTInOK8GRvQqHdx2-848ZQXj3-JI-SDiSw","e":"AQAB"},"attributes":{"enabled":true,"exp":2527401600,"created":1438729190,"updated":1438729192},"tags":{"foo":"1c2113c5908b1633b597923b338e697e6396c6b61dea3431fd058d6efb89d103d134e7d6c14ec3c37686dccf447009884afa"}}, { 'cache-control': 'no-cache', +nock('https://sdktestvault0511.vault.azure.net') + .delete('/keys/nodeKey?api-version=2015-06-01') + .reply(200, "{\"key\":{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/82a87ff5b7674935bbb0d6a7d4cf341a\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\"],\"n\":\"oG5TeCVVRYmyoE9OQDEJYmqMKcksLcpNuX0XA2GZTB2jdzVbOiSw0tC8lISngYSJ1UFPpsp2sHSHPshuxpL_AI4GF8yMCtdTI-uOWGJdADi46dg-Mq4w_6oJD_ssl58ZUYMR1VRne2HOMQPwM2BzdiKWnGfrE4tdgSOC6eiLZT0IEBObm8zPOPRudKpm79M69n_xSnVJE2vJd0D0_7cdUrMREqpVNn6A4o3190_ot7KM9xv3yswuXktbJL42X9chFamAbKtbW8M4bRtIT-OQMTjWG7m1tY38pncUK3eRYhXReUkm3FRFbq406FxdtXGAn5kMuDofbOH9k-n5ql1Tyw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"exp\":2527401600,\"created\":1470959463,\"updated\":1470959467},\"tags\":{\"foo\":\"1c2113c5908b1633b597923b338e697e6396c6b61dea3431fd058d6efb89d103d134e7d6c14ec3c37686dccf447009884afa\"}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '4f0aad91-2b00-468a-b7dd-a642aefeadf8', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 22:59:52 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:07 GMT', connection: 'close', - 'content-length': '714' }); + 'content-length': '715' }); return result; }, function (nock) { var result = -nock('http://nodesdktest.vault.azure.net:443') +nock('http://sdktestvault0511.vault.azure.net') .get('/keys/nodeKey/?api-version=2015-06-01') - .reply(404, {"error":{"code":"KeyNotFound","message":"Key nodeKey not found"}}, { 'cache-control': 'no-cache', + .reply(404, "{\"error\":{\"code\":\"KeyNotFound\",\"message\":\"Key nodeKey not found\"}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-length': '66', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '75eb4be3-38cd-4f2c-89d3-9baff7bd0310', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 22:59:53 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:08 GMT', connection: 'close' }); return result; }, function (nock) { var result = -nock('https://nodesdktest.vault.azure.net:443') +nock('https://sdktestvault0511.vault.azure.net') .get('/keys/nodeKey/?api-version=2015-06-01') - .reply(404, {"error":{"code":"KeyNotFound","message":"Key nodeKey not found"}}, { 'cache-control': 'no-cache', + .reply(404, "{\"error\":{\"code\":\"KeyNotFound\",\"message\":\"Key nodeKey not found\"}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-length': '66', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '75eb4be3-38cd-4f2c-89d3-9baff7bd0310', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 22:59:53 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:08 GMT', connection: 'close' }); return result; }], [function (nock) { var result = -nock('http://nodesdktest.vault.azure.net:443') +nock('http://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) -.put('/keys/nodeKey/import?api-version=2015-06-01', '*') - .reply(200, {"key":{"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/c95658b1b63740e7a2c2ca1ffa2f17dd","kty":"RSA","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"2E2mRyr2K55w1RHwmMTGkW5Z4ZKBmf-BlL4It1yZZkYks4k0QkNHDjFqLMkQkXL8bEMJ5doAq7WUWKOG4JBlIwBpoYBjgtI97TCARH1yTA1s3TDc2ZYlSnCBohlw6r68OYOjHHWpY4J3HgeoNuLkIMTcM5el3zI0F11OBUgC0PyuZ9rlZc_4C0NGAg604vmiz6dOjY-o-KnGOfo1qyfMl1DDCeEur-Dy0UEFB6XeSd4SlNHlc3-ViN23flWTSgw710RYRaL8XHar6O7Ml4nqO7KKvSJcHnZgPzZDsoqxvNnbpwuCr_2pOrjy2ygJy2Gz_H4nhobDxzy1pXogEd8snQ","e":"AQAB"},"attributes":{"enabled":true,"created":1438729194,"updated":1438729194}}, { 'cache-control': 'no-cache', +.put('/keys/nodeKey?api-version=2015-06-01', '*') + .reply(200, "{\"key\":{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/acfab6b63d00437ea154e25dcf3cc7be\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"2E2mRyr2K55w1RHwmMTGkW5Z4ZKBmf-BlL4It1yZZkYks4k0QkNHDjFqLMkQkXL8bEMJ5doAq7WUWKOG4JBlIwBpoYBjgtI97TCARH1yTA1s3TDc2ZYlSnCBohlw6r68OYOjHHWpY4J3HgeoNuLkIMTcM5el3zI0F11OBUgC0PyuZ9rlZc_4C0NGAg604vmiz6dOjY-o-KnGOfo1qyfMl1DDCeEur-Dy0UEFB6XeSd4SlNHlc3-ViN23flWTSgw710RYRaL8XHar6O7Ml4nqO7KKvSJcHnZgPzZDsoqxvNnbpwuCr_2pOrjy2ygJy2Gz_H4nhobDxzy1pXogEd8snQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1470959468,\"updated\":1470959468}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '8c58b8a8-7051-4f0a-b6b3-a61d964553f9', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 22:59:54 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:08 GMT', connection: 'close', - 'content-length': '617' }); + 'content-length': '618' }); return result; }, function (nock) { var result = -nock('https://nodesdktest.vault.azure.net:443') +nock('https://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) -.put('/keys/nodeKey/import?api-version=2015-06-01', '*') - .reply(200, {"key":{"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/c95658b1b63740e7a2c2ca1ffa2f17dd","kty":"RSA","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"2E2mRyr2K55w1RHwmMTGkW5Z4ZKBmf-BlL4It1yZZkYks4k0QkNHDjFqLMkQkXL8bEMJ5doAq7WUWKOG4JBlIwBpoYBjgtI97TCARH1yTA1s3TDc2ZYlSnCBohlw6r68OYOjHHWpY4J3HgeoNuLkIMTcM5el3zI0F11OBUgC0PyuZ9rlZc_4C0NGAg604vmiz6dOjY-o-KnGOfo1qyfMl1DDCeEur-Dy0UEFB6XeSd4SlNHlc3-ViN23flWTSgw710RYRaL8XHar6O7Ml4nqO7KKvSJcHnZgPzZDsoqxvNnbpwuCr_2pOrjy2ygJy2Gz_H4nhobDxzy1pXogEd8snQ","e":"AQAB"},"attributes":{"enabled":true,"created":1438729194,"updated":1438729194}}, { 'cache-control': 'no-cache', +.put('/keys/nodeKey?api-version=2015-06-01', '*') + .reply(200, "{\"key\":{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/acfab6b63d00437ea154e25dcf3cc7be\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"2E2mRyr2K55w1RHwmMTGkW5Z4ZKBmf-BlL4It1yZZkYks4k0QkNHDjFqLMkQkXL8bEMJ5doAq7WUWKOG4JBlIwBpoYBjgtI97TCARH1yTA1s3TDc2ZYlSnCBohlw6r68OYOjHHWpY4J3HgeoNuLkIMTcM5el3zI0F11OBUgC0PyuZ9rlZc_4C0NGAg604vmiz6dOjY-o-KnGOfo1qyfMl1DDCeEur-Dy0UEFB6XeSd4SlNHlc3-ViN23flWTSgw710RYRaL8XHar6O7Ml4nqO7KKvSJcHnZgPzZDsoqxvNnbpwuCr_2pOrjy2ygJy2Gz_H4nhobDxzy1pXogEd8snQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1470959468,\"updated\":1470959468}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '8c58b8a8-7051-4f0a-b6b3-a61d964553f9', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 22:59:54 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:08 GMT', connection: 'close', - 'content-length': '617' }); + 'content-length': '618' }); return result; }, function (nock) { var result = -nock('http://nodesdktest.vault.azure.net:443') +nock('http://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) -.put('/keys/nodeKey/import?api-version=2015-06-01', '*') - .reply(200, {"key":{"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/41056d86417b4c6881c1779880bb886e","kty":"RSA-HSM","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"2E2mRyr2K55w1RHwmMTGkW5Z4ZKBmf-BlL4It1yZZkYks4k0QkNHDjFqLMkQkXL8bEMJ5doAq7WUWKOG4JBlIwBpoYBjgtI97TCARH1yTA1s3TDc2ZYlSnCBohlw6r68OYOjHHWpY4J3HgeoNuLkIMTcM5el3zI0F11OBUgC0PyuZ9rlZc_4C0NGAg604vmiz6dOjY-o-KnGOfo1qyfMl1DDCeEur-Dy0UEFB6XeSd4SlNHlc3-ViN23flWTSgw710RYRaL8XHar6O7Ml4nqO7KKvSJcHnZgPzZDsoqxvNnbpwuCr_2pOrjy2ygJy2Gz_H4nhobDxzy1pXogEd8snQ","e":"AQAB"},"attributes":{"enabled":true,"created":1438729195,"updated":1438729195}}, { 'cache-control': 'no-cache', +.put('/keys/nodeKey?api-version=2015-06-01', '*') + .reply(200, "{\"key\":{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/b2d1af600e894f728c0edd941f787fd1\",\"kty\":\"RSA-HSM\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"2E2mRyr2K55w1RHwmMTGkW5Z4ZKBmf-BlL4It1yZZkYks4k0QkNHDjFqLMkQkXL8bEMJ5doAq7WUWKOG4JBlIwBpoYBjgtI97TCARH1yTA1s3TDc2ZYlSnCBohlw6r68OYOjHHWpY4J3HgeoNuLkIMTcM5el3zI0F11OBUgC0PyuZ9rlZc_4C0NGAg604vmiz6dOjY-o-KnGOfo1qyfMl1DDCeEur-Dy0UEFB6XeSd4SlNHlc3-ViN23flWTSgw710RYRaL8XHar6O7Ml4nqO7KKvSJcHnZgPzZDsoqxvNnbpwuCr_2pOrjy2ygJy2Gz_H4nhobDxzy1pXogEd8snQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1470959469,\"updated\":1470959469}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'ee5052e1-3094-4463-b1a7-7ee1778fd55f', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 22:59:55 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:09 GMT', connection: 'close', - 'content-length': '621' }); + 'content-length': '622' }); return result; }, function (nock) { var result = -nock('https://nodesdktest.vault.azure.net:443') +nock('https://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) -.put('/keys/nodeKey/import?api-version=2015-06-01', '*') - .reply(200, {"key":{"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/41056d86417b4c6881c1779880bb886e","kty":"RSA-HSM","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"2E2mRyr2K55w1RHwmMTGkW5Z4ZKBmf-BlL4It1yZZkYks4k0QkNHDjFqLMkQkXL8bEMJ5doAq7WUWKOG4JBlIwBpoYBjgtI97TCARH1yTA1s3TDc2ZYlSnCBohlw6r68OYOjHHWpY4J3HgeoNuLkIMTcM5el3zI0F11OBUgC0PyuZ9rlZc_4C0NGAg604vmiz6dOjY-o-KnGOfo1qyfMl1DDCeEur-Dy0UEFB6XeSd4SlNHlc3-ViN23flWTSgw710RYRaL8XHar6O7Ml4nqO7KKvSJcHnZgPzZDsoqxvNnbpwuCr_2pOrjy2ygJy2Gz_H4nhobDxzy1pXogEd8snQ","e":"AQAB"},"attributes":{"enabled":true,"created":1438729195,"updated":1438729195}}, { 'cache-control': 'no-cache', +.put('/keys/nodeKey?api-version=2015-06-01', '*') + .reply(200, "{\"key\":{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/b2d1af600e894f728c0edd941f787fd1\",\"kty\":\"RSA-HSM\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"2E2mRyr2K55w1RHwmMTGkW5Z4ZKBmf-BlL4It1yZZkYks4k0QkNHDjFqLMkQkXL8bEMJ5doAq7WUWKOG4JBlIwBpoYBjgtI97TCARH1yTA1s3TDc2ZYlSnCBohlw6r68OYOjHHWpY4J3HgeoNuLkIMTcM5el3zI0F11OBUgC0PyuZ9rlZc_4C0NGAg604vmiz6dOjY-o-KnGOfo1qyfMl1DDCeEur-Dy0UEFB6XeSd4SlNHlc3-ViN23flWTSgw710RYRaL8XHar6O7Ml4nqO7KKvSJcHnZgPzZDsoqxvNnbpwuCr_2pOrjy2ygJy2Gz_H4nhobDxzy1pXogEd8snQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1470959469,\"updated\":1470959469}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'ee5052e1-3094-4463-b1a7-7ee1778fd55f', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 22:59:55 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:09 GMT', connection: 'close', - 'content-length': '621' }); + 'content-length': '622' }); return result; }], [function (nock) { var result = -nock('http://nodesdktest.vault.azure.net:443') +nock('http://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.post('/keys/nodeKey1/create?api-version=2015-06-01', '*') + .reply(200, "{\"key\":{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey1/0630f91ffb5641c9859d6a306b6ff96d\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"mgC0pMMJ921mW_WUD7HtSFDmeFFSsUQdyzcR1eE1Rlt5Ld_kWogArTL18h8fs59Ul8Y9-GtuAh-3NKltWmI-poO0vdr0UX-6gH6-KCzfGCkgBwk2V_btqLC2-4QsnJKvh7sG_aNzb_bJyov9nNOqtUCAEgABfgc07bwgx7pMeG48-zEl2iH-0J258tW6-EwCBsqHWCTT9OrN2HeTMnDKIbrEdPG9g9pOuwPvtL-R1qdt2vmbbiFoTztTEdqrqebO8j1YkPbqgrmyaB9xpKmt_-oBamIdyPBIYsSgxPSsixhLZTxnJFL75zy08sZx2ati7m21K7CQrr5TdcVXgzWN8w\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1470959470,\"updated\":1470959470}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '6147659c-adbc-4ec2-aa78-6c50afa99ae5', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:10 GMT', + connection: 'close', + 'content-length': '619' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.post('/keys/nodeKey1/create?api-version=2015-06-01', '*') + .reply(200, "{\"key\":{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey1/0630f91ffb5641c9859d6a306b6ff96d\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"mgC0pMMJ921mW_WUD7HtSFDmeFFSsUQdyzcR1eE1Rlt5Ld_kWogArTL18h8fs59Ul8Y9-GtuAh-3NKltWmI-poO0vdr0UX-6gH6-KCzfGCkgBwk2V_btqLC2-4QsnJKvh7sG_aNzb_bJyov9nNOqtUCAEgABfgc07bwgx7pMeG48-zEl2iH-0J258tW6-EwCBsqHWCTT9OrN2HeTMnDKIbrEdPG9g9pOuwPvtL-R1qdt2vmbbiFoTztTEdqrqebO8j1YkPbqgrmyaB9xpKmt_-oBamIdyPBIYsSgxPSsixhLZTxnJFL75zy08sZx2ati7m21K7CQrr5TdcVXgzWN8w\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1470959470,\"updated\":1470959470}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '6147659c-adbc-4ec2-aa78-6c50afa99ae5', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:10 GMT', + connection: 'close', + 'content-length': '619' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.post('/keys/nodeKey2/create?api-version=2015-06-01', '*') + .reply(200, "{\"key\":{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey2/a059f1b07eca49c9ab2c1f0877461c26\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"ij6ti3OxejRqIdnhzSxlPzzqhorNFRXMW5hmDv15mV1kWm7iMArVi7jh6kNfxJ8QzcHjj94C_PvH0l4uz-vIcIqWfBRYq_p55RjMiDmjWf3VEONzl10dcTt9LxFsHlWJQPLg93u3wsVSiYlfLfWXUg0BGVmHydCwgbmsq6F8wr-FIJ1HOxtRJfjROrm_1GkgIDha5sCp5Tb_bAeuD8I8eFbgF3orjLiNz1ooUZ1sPZMtCwwa7zo96DRIpQG_oc5DnlmJG_ZMxKitfJ0NLgMEYTq8CoJEW89lrLzaGjSPUOICXUdbAQ3kEQbsZ4XHr0rjlViz-fZA1rzY1StUxtzG3w\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1470959471,\"updated\":1470959471}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '145827c9-4f1a-45ae-ade2-2d2cc30277a4', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:11 GMT', + connection: 'close', + 'content-length': '619' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.post('/keys/nodeKey2/create?api-version=2015-06-01', '*') + .reply(200, "{\"key\":{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey2/a059f1b07eca49c9ab2c1f0877461c26\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"ij6ti3OxejRqIdnhzSxlPzzqhorNFRXMW5hmDv15mV1kWm7iMArVi7jh6kNfxJ8QzcHjj94C_PvH0l4uz-vIcIqWfBRYq_p55RjMiDmjWf3VEONzl10dcTt9LxFsHlWJQPLg93u3wsVSiYlfLfWXUg0BGVmHydCwgbmsq6F8wr-FIJ1HOxtRJfjROrm_1GkgIDha5sCp5Tb_bAeuD8I8eFbgF3orjLiNz1ooUZ1sPZMtCwwa7zo96DRIpQG_oc5DnlmJG_ZMxKitfJ0NLgMEYTq8CoJEW89lrLzaGjSPUOICXUdbAQ3kEQbsZ4XHr0rjlViz-fZA1rzY1StUxtzG3w\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1470959471,\"updated\":1470959471}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '145827c9-4f1a-45ae-ade2-2d2cc30277a4', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:11 GMT', + connection: 'close', + 'content-length': '619' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/keys?maxresults=2&api-version=2015-06-01') + .reply(200, "{\"value\":[{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/createManualEnrollmentJava4\",\"attributes\":{\"enabled\":true,\"nbf\":1469048531,\"exp\":1500585131,\"created\":1469049131,\"updated\":1469049131},\"managed\":true},{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/createManualEnrollmentJava6\",\"attributes\":{\"enabled\":true,\"nbf\":1469567919,\"exp\":1501104519,\"created\":1469568520,\"updated\":1469568520},\"managed\":true}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/keys?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDAhTURBd01ETXhJV3RsZVM5RFVrVkJWRVZOUVU1VlFVeEZUbEpQVEV4TlJVNVVTa0ZXUVRjaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '0d951bc5-cf6e-42ce-bfcb-9f6bec0114a6', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:11 GMT', + connection: 'close', + 'content-length': '722' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/keys?maxresults=2&api-version=2015-06-01') + .reply(200, "{\"value\":[{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/createManualEnrollmentJava4\",\"attributes\":{\"enabled\":true,\"nbf\":1469048531,\"exp\":1500585131,\"created\":1469049131,\"updated\":1469049131},\"managed\":true},{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/createManualEnrollmentJava6\",\"attributes\":{\"enabled\":true,\"nbf\":1469567919,\"exp\":1501104519,\"created\":1469568520,\"updated\":1469568520},\"managed\":true}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/keys?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDAhTURBd01ETXhJV3RsZVM5RFVrVkJWRVZOUVU1VlFVeEZUbEpQVEV4TlJVNVVTa0ZXUVRjaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '0d951bc5-cf6e-42ce-bfcb-9f6bec0114a6', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:11 GMT', + connection: 'close', + 'content-length': '722' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/keys?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDAhTURBd01ETXhJV3RsZVM5RFVrVkJWRVZOUVU1VlFVeEZUbEpQVEV4TlJVNVVTa0ZXUVRjaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/createManualEnrollmentJava7\",\"attributes\":{\"enabled\":true,\"nbf\":1469568292,\"exp\":1501104892,\"created\":1469568892,\"updated\":1469568892},\"managed\":true},{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/createManualEnrollmentJava8\",\"attributes\":{\"enabled\":true,\"nbf\":1469569754,\"exp\":1501106354,\"created\":1469570354,\"updated\":1469570354},\"managed\":true}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/keys?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDAhTURBd01ETXhJV3RsZVM5RFVrVkJWRVZOUVU1VlFVeEZUbEpQVEV4TlJVNVVTa0ZXUVRraE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'a7ddf812-5cf0-4952-b679-2dc21b18bbae', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:13 GMT', + connection: 'close', + 'content-length': '722' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/keys?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDAhTURBd01ETXhJV3RsZVM5RFVrVkJWRVZOUVU1VlFVeEZUbEpQVEV4TlJVNVVTa0ZXUVRjaE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/createManualEnrollmentJava7\",\"attributes\":{\"enabled\":true,\"nbf\":1469568292,\"exp\":1501104892,\"created\":1469568892,\"updated\":1469568892},\"managed\":true},{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/createManualEnrollmentJava8\",\"attributes\":{\"enabled\":true,\"nbf\":1469569754,\"exp\":1501106354,\"created\":1469570354,\"updated\":1469570354},\"managed\":true}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/keys?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDAhTURBd01ETXhJV3RsZVM5RFVrVkJWRVZOUVU1VlFVeEZUbEpQVEV4TlJVNVVTa0ZXUVRraE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'a7ddf812-5cf0-4952-b679-2dc21b18bbae', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:13 GMT', + connection: 'close', + 'content-length': '722' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/keys?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDAhTURBd01ETXhJV3RsZVM5RFVrVkJWRVZOUVU1VlFVeEZUbEpQVEV4TlJVNVVTa0ZXUVRraE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/createManualEnrollmentJava9\",\"attributes\":{\"enabled\":true,\"nbf\":1469574262,\"exp\":1501110862,\"created\":1469574863,\"updated\":1469574863},\"managed\":true},{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/importListCertificate1\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470959365,\"updated\":1470959365},\"managed\":true}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/keys?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5NiFNREF3TURJMklXdGxlUzlKVFZCUFVsUk1TVk5VUTBWU1ZFbEdTVU5CVkVVeUlUQXdNREF5T0NFNU9UazVMVEV5TFRNeFZESXpPalU1T2pVNUxqazVPVGs1T1RsYUlRLS0iLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '1a9ea45a-553b-4b4e-8029-ad3bbac581c9', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:13 GMT', + connection: 'close', + 'content-length': '710' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/keys?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDAhTURBd01ETXhJV3RsZVM5RFVrVkJWRVZOUVU1VlFVeEZUbEpQVEV4TlJVNVVTa0ZXUVRraE1EQXdNREk0SVRrNU9Ua3RNVEl0TXpGVU1qTTZOVGs2TlRrdU9UazVPVGs1T1ZvaCIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/createManualEnrollmentJava9\",\"attributes\":{\"enabled\":true,\"nbf\":1469574262,\"exp\":1501110862,\"created\":1469574863,\"updated\":1469574863},\"managed\":true},{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/importListCertificate1\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470959365,\"updated\":1470959365},\"managed\":true}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/keys?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5NiFNREF3TURJMklXdGxlUzlKVFZCUFVsUk1TVk5VUTBWU1ZFbEdTVU5CVkVVeUlUQXdNREF5T0NFNU9UazVMVEV5TFRNeFZESXpPalU1T2pVNUxqazVPVGs1T1RsYUlRLS0iLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '1a9ea45a-553b-4b4e-8029-ad3bbac581c9', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:13 GMT', + connection: 'close', + 'content-length': '710' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/keys?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5NiFNREF3TURJMklXdGxlUzlKVFZCUFVsUk1TVk5VUTBWU1ZFbEdTVU5CVkVVeUlUQXdNREF5T0NFNU9UazVMVEV5TFRNeFZESXpPalU1T2pVNUxqazVPVGs1T1RsYUlRLS0iLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2') + .reply(200, "{\"value\":[{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/importListCertificate2\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470959367,\"updated\":1470959367},\"managed\":true},{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/importListVersionCerts\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470959376,\"updated\":1470959376},\"managed\":true}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/keys?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4OCFNREF3TURJd0lXdGxlUzlNU1ZOVVEwVlNWRWxHU1VOQlZFVXdJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '668cf6fa-6cca-447a-a6ea-59cd2fb84879', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:14 GMT', + connection: 'close', + 'content-length': '694' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/keys?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5NiFNREF3TURJMklXdGxlUzlKVFZCUFVsUk1TVk5VUTBWU1ZFbEdTVU5CVkVVeUlUQXdNREF5T0NFNU9UazVMVEV5TFRNeFZESXpPalU1T2pVNUxqazVPVGs1T1RsYUlRLS0iLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2') + .reply(200, "{\"value\":[{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/importListCertificate2\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470959367,\"updated\":1470959367},\"managed\":true},{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/importListVersionCerts\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470959376,\"updated\":1470959376},\"managed\":true}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/keys?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4OCFNREF3TURJd0lXdGxlUzlNU1ZOVVEwVlNWRWxHU1VOQlZFVXdJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '668cf6fa-6cca-447a-a6ea-59cd2fb84879', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:14 GMT', + connection: 'close', + 'content-length': '694' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/keys?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4OCFNREF3TURJd0lXdGxlUzlNU1ZOVVEwVlNWRWxHU1VOQlZFVXdJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2') + .reply(200, "{\"value\":[{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/listCertificate0\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470774077,\"updated\":1470774077},\"managed\":true},{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/listCertificate1\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470774079,\"updated\":1470774079},\"managed\":true}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/keys?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4OCFNREF3TURJd0lXdGxlUzlNU1ZOVVEwVlNWRWxHU1VOQlZFVXlJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'f58c49b3-f843-41b1-acbc-1697ef59f152', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:14 GMT', + connection: 'close', + 'content-length': '682' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/keys?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4OCFNREF3TURJd0lXdGxlUzlNU1ZOVVEwVlNWRWxHU1VOQlZFVXdJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2') + .reply(200, "{\"value\":[{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/listCertificate0\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470774077,\"updated\":1470774077},\"managed\":true},{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/listCertificate1\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470774079,\"updated\":1470774079},\"managed\":true}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/keys?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4OCFNREF3TURJd0lXdGxlUzlNU1ZOVVEwVlNWRWxHU1VOQlZFVXlJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'f58c49b3-f843-41b1-acbc-1697ef59f152', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:14 GMT', + connection: 'close', + 'content-length': '682' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/keys?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4OCFNREF3TURJd0lXdGxlUzlNU1ZOVVEwVlNWRWxHU1VOQlZFVXlJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2') + .reply(200, "{\"value\":[{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/listCertificate2\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470774080,\"updated\":1470774080},\"managed\":true},{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/listCertificate3\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470774081,\"updated\":1470774081},\"managed\":true}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/keys?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4NCFNREF3TURFNUlXdGxlUzlPVDBSRlEwVlNWRWxHU1VOQlZFVWhNREF3TURJNElUazVPVGt0TVRJdE16RlVNak02TlRrNk5Ua3VPVGs1T1RrNU9Wb2giLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '2a8dd58c-8764-41ef-8d69-aad0a7c998d9', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:15 GMT', + connection: 'close', + 'content-length': '677' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/keys?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4OCFNREF3TURJd0lXdGxlUzlNU1ZOVVEwVlNWRWxHU1VOQlZFVXlJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2') + .reply(200, "{\"value\":[{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/listCertificate2\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470774080,\"updated\":1470774080},\"managed\":true},{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/listCertificate3\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470774081,\"updated\":1470774081},\"managed\":true}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/keys?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4NCFNREF3TURFNUlXdGxlUzlPVDBSRlEwVlNWRWxHU1VOQlZFVWhNREF3TURJNElUazVPVGt0TVRJdE16RlVNak02TlRrNk5Ua3VPVGs1T1RrNU9Wb2giLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '2a8dd58c-8764-41ef-8d69-aad0a7c998d9', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:15 GMT', + connection: 'close', + 'content-length': '677' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/keys?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4NCFNREF3TURFNUlXdGxlUzlPVDBSRlEwVlNWRWxHU1VOQlZFVWhNREF3TURJNElUazVPVGt0TVRJdE16RlVNak02TlRrNk5Ua3VPVGs1T1RrNU9Wb2giLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2') + .reply(200, "{\"value\":[{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeImportCertificate\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470959363,\"updated\":1470959363},\"managed\":true},{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey\",\"attributes\":{\"enabled\":true,\"created\":1470959469,\"updated\":1470959469}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/keys?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE3NiFNREF3TURFeUlXdGxlUzlPVDBSRlMwVlpNU0V3TURBd01qZ2hPVGs1T1MweE1pMHpNVlF5TXpvMU9UbzFPUzQ1T1RrNU9UazVXaUUtIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'f6bb2fab-735d-464a-8795-cb28ac0b1a23', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:15 GMT', + connection: 'close', + 'content-length': '613' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/keys?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4NCFNREF3TURFNUlXdGxlUzlPVDBSRlEwVlNWRWxHU1VOQlZFVWhNREF3TURJNElUazVPVGt0TVRJdE16RlVNak02TlRrNk5Ua3VPVGs1T1RrNU9Wb2giLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2') + .reply(200, "{\"value\":[{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeImportCertificate\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470959363,\"updated\":1470959363},\"managed\":true},{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey\",\"attributes\":{\"enabled\":true,\"created\":1470959469,\"updated\":1470959469}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/keys?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE3NiFNREF3TURFeUlXdGxlUzlPVDBSRlMwVlpNU0V3TURBd01qZ2hPVGs1T1MweE1pMHpNVlF5TXpvMU9UbzFPUzQ1T1RrNU9UazVXaUUtIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'f6bb2fab-735d-464a-8795-cb28ac0b1a23', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:15 GMT', + connection: 'close', + 'content-length': '613' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/keys?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE3NiFNREF3TURFeUlXdGxlUzlPVDBSRlMwVlpNU0V3TURBd01qZ2hPVGs1T1MweE1pMHpNVlF5TXpvMU9UbzFPUzQ1T1RrNU9UazVXaUUtIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2') + .reply(200, "{\"value\":[{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey1\",\"attributes\":{\"enabled\":true,\"created\":1470959470,\"updated\":1470959470}},{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey2\",\"attributes\":{\"enabled\":true,\"created\":1470959471,\"updated\":1470959471}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/keys?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4NCFNREF3TURFM0lXdGxlUzlPVDBSRlMwVlpSazlTUWt0UUlUQXdNREF5T0NFNU9UazVMVEV5TFRNeFZESXpPalU1T2pVNUxqazVPVGs1T1RsYUlRLS0iLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'cd6ce0e1-04a4-4181-a3fd-7307b7ff27ea', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:16 GMT', + connection: 'close', + 'content-length': '563' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/keys?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE3NiFNREF3TURFeUlXdGxlUzlPVDBSRlMwVlpNU0V3TURBd01qZ2hPVGs1T1MweE1pMHpNVlF5TXpvMU9UbzFPUzQ1T1RrNU9UazVXaUUtIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2') + .reply(200, "{\"value\":[{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey1\",\"attributes\":{\"enabled\":true,\"created\":1470959470,\"updated\":1470959470}},{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey2\",\"attributes\":{\"enabled\":true,\"created\":1470959471,\"updated\":1470959471}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/keys?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4NCFNREF3TURFM0lXdGxlUzlPVDBSRlMwVlpSazlTUWt0UUlUQXdNREF5T0NFNU9UazVMVEV5TFRNeFZESXpPalU1T2pVNUxqazVPVGs1T1RsYUlRLS0iLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'cd6ce0e1-04a4-4181-a3fd-7307b7ff27ea', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:16 GMT', + connection: 'close', + 'content-length': '563' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/keys?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4NCFNREF3TURFM0lXdGxlUzlPVDBSRlMwVlpSazlTUWt0UUlUQXdNREF5T0NFNU9UazVMVEV5TFRNeFZESXpPalU1T2pVNUxqazVPVGs1T1RsYUlRLS0iLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2') + .reply(200, "{\"value\":[{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/policyCertificate\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470959397,\"updated\":1470959397},\"managed\":true},{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/UnknownIssuerCert\",\"attributes\":{\"enabled\":true,\"nbf\":1469493191,\"exp\":1501029791,\"created\":1469493792,\"updated\":1469493792},\"managed\":true}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/keys?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4OCFNREF3TURJeUlXdGxlUzlWVGt0T1QxZE9TVk5UVlVWU1EwVlNWREVoTURBd01ESTRJVGs1T1RrdE1USXRNekZVTWpNNk5UazZOVGt1T1RrNU9UazVPVm9oIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'fabd46cd-8faa-439d-be66-cdc4f2b4e883', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:16 GMT', + connection: 'close', + 'content-length': '684' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/keys?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4NCFNREF3TURFM0lXdGxlUzlPVDBSRlMwVlpSazlTUWt0UUlUQXdNREF5T0NFNU9UazVMVEV5TFRNeFZESXpPalU1T2pVNUxqazVPVGs1T1RsYUlRLS0iLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2') + .reply(200, "{\"value\":[{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/policyCertificate\",\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470959397,\"updated\":1470959397},\"managed\":true},{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/UnknownIssuerCert\",\"attributes\":{\"enabled\":true,\"nbf\":1469493191,\"exp\":1501029791,\"created\":1469493792,\"updated\":1469493792},\"managed\":true}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/keys?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4OCFNREF3TURJeUlXdGxlUzlWVGt0T1QxZE9TVk5UVlVWU1EwVlNWREVoTURBd01ESTRJVGs1T1RrdE1USXRNekZVTWpNNk5UazZOVGt1T1RrNU9UazVPVm9oIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'fabd46cd-8faa-439d-be66-cdc4f2b4e883', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:16 GMT', + connection: 'close', + 'content-length': '684' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/keys?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4OCFNREF3TURJeUlXdGxlUzlWVGt0T1QxZE9TVk5UVlVWU1EwVlNWREVoTURBd01ESTRJVGs1T1RrdE1USXRNekZVTWpNNk5UazZOVGt1T1RrNU9UazVPVm9oIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2') + .reply(200, "{\"value\":[],\"nextLink\":null}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '7a207396-a7a9-46eb-bd81-070c71231afe', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:16 GMT', + connection: 'close', + 'content-length': '28' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/keys?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4OCFNREF3TURJeUlXdGxlUzlWVGt0T1QxZE9TVk5UVlVWU1EwVlNWREVoTURBd01ESTRJVGs1T1RrdE1USXRNekZVTWpNNk5UazZOVGt1T1RrNU9UazVPVm9oIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2') + .reply(200, "{\"value\":[],\"nextLink\":null}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '7a207396-a7a9-46eb-bd81-070c71231afe', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:16 GMT', + connection: 'close', + 'content-length': '28' }); + return result; }], +[function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.post('/keys/nodeKey/create?api-version=2015-06-01', '*') + .reply(200, "{\"key\":{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/c44ee5c410984f579ab17c7c865a2fd1\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"iVnIcfvb6785Mii4r2qx6YjGvgFy7HnMV-Ro99YnWfLvBudDy_Ial_zqEUAdJ8gnN-HWf3VU4Y7qZ54_FT9Y6A3rBY1sEwDkf-lspfmPjk5ixfPoGvFbNJk7xb0PG28DQ3WNU91U0tRTxKlid54azn0JAeG0Ksha3ytRtqabdJfw9wPA3V6R8oOCjsv9XexCCzFrKcVhxFmdCGM0ODB_wkqDNsC8xzqfMLKVoV4ZLCEaWCHgNHCJ29J-DolNz-MBe2em6TtLzLfEbeaT7Hok-ULZbJxUGvzTu5gxZuyTTLuuAnb-Zz2-eHyeEbh_T5fpE13g_vLz3adVzRcB4Nztuw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1470959477,\"updated\":1470959477}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'de0adfe1-f393-4355-923f-698c52aa2390', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:17 GMT', + connection: 'close', + 'content-length': '618' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.post('/keys/nodeKey/create?api-version=2015-06-01', '*') + .reply(200, "{\"key\":{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/c44ee5c410984f579ab17c7c865a2fd1\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"iVnIcfvb6785Mii4r2qx6YjGvgFy7HnMV-Ro99YnWfLvBudDy_Ial_zqEUAdJ8gnN-HWf3VU4Y7qZ54_FT9Y6A3rBY1sEwDkf-lspfmPjk5ixfPoGvFbNJk7xb0PG28DQ3WNU91U0tRTxKlid54azn0JAeG0Ksha3ytRtqabdJfw9wPA3V6R8oOCjsv9XexCCzFrKcVhxFmdCGM0ODB_wkqDNsC8xzqfMLKVoV4ZLCEaWCHgNHCJ29J-DolNz-MBe2em6TtLzLfEbeaT7Hok-ULZbJxUGvzTu5gxZuyTTLuuAnb-Zz2-eHyeEbh_T5fpE13g_vLz3adVzRcB4Nztuw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1470959477,\"updated\":1470959477}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'de0adfe1-f393-4355-923f-698c52aa2390', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:17 GMT', + connection: 'close', + 'content-length': '618' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.post('/keys/nodeKey/create?api-version=2015-06-01', '*') + .reply(200, "{\"key\":{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/43dbbaa134c7450aa2b0585764c18a64\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"vT4-jSDhgt5-PWLchkhXa2l_J1x06exYPtHCKeyLsLvFCMv865rtatRZuLh8m08RDWsoc4KIyPUTfS60V7Tj9e11eLtU4Kfu_k6d_qzLU55r6QfC5CJjG_LMoatY0AHIGJocEXNBtZi-0rcDPV4_jTxAkQb0ZYG3XO-8uw0vvFlvgU6mxzBgWKT97SnCXcJzmQ9iJ5w-MPJM9qbbUk6O-3Tc1jZHChvdOg5r8IvAS2bIUfGn0sWPbYVPTmJ_AX5XMR0fCwYtDdtde3w-zy680LBYKzMTT7g22Xvj6knihXZ28aIdQ7LCwX7Rrzst9Hq6Yo4WDWmlei4ZzXrgs_Ytnw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1470959478,\"updated\":1470959478}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '6357e221-500c-4678-bc21-db903a521976', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:18 GMT', + connection: 'close', + 'content-length': '618' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.post('/keys/nodeKey/create?api-version=2015-06-01', '*') + .reply(200, "{\"key\":{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/43dbbaa134c7450aa2b0585764c18a64\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"vT4-jSDhgt5-PWLchkhXa2l_J1x06exYPtHCKeyLsLvFCMv865rtatRZuLh8m08RDWsoc4KIyPUTfS60V7Tj9e11eLtU4Kfu_k6d_qzLU55r6QfC5CJjG_LMoatY0AHIGJocEXNBtZi-0rcDPV4_jTxAkQb0ZYG3XO-8uw0vvFlvgU6mxzBgWKT97SnCXcJzmQ9iJ5w-MPJM9qbbUk6O-3Tc1jZHChvdOg5r8IvAS2bIUfGn0sWPbYVPTmJ_AX5XMR0fCwYtDdtde3w-zy680LBYKzMTT7g22Xvj6knihXZ28aIdQ7LCwX7Rrzst9Hq6Yo4WDWmlei4ZzXrgs_Ytnw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1470959478,\"updated\":1470959478}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '6357e221-500c-4678-bc21-db903a521976', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:18 GMT', + connection: 'close', + 'content-length': '618' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/keys/nodeKey/versions?api-version=2015-06-01') + .reply(200, "{\"value\":[{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/43dbbaa134c7450aa2b0585764c18a64\",\"attributes\":{\"enabled\":true,\"created\":1470959478,\"updated\":1470959478}},{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/acfab6b63d00437ea154e25dcf3cc7be\",\"attributes\":{\"enabled\":true,\"created\":1470959468,\"updated\":1470959468}},{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/b2d1af600e894f728c0edd941f787fd1\",\"attributes\":{\"enabled\":true,\"created\":1470959469,\"updated\":1470959469}},{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/c44ee5c410984f579ab17c7c865a2fd1\",\"attributes\":{\"enabled\":true,\"created\":1470959477,\"updated\":1470959477}}],\"nextLink\":null}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '84246ec8-ed87-4a84-95e1-3e929bb10ceb', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:18 GMT', + connection: 'close', + 'content-length': '703' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/keys/nodeKey/versions?api-version=2015-06-01') + .reply(200, "{\"value\":[{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/43dbbaa134c7450aa2b0585764c18a64\",\"attributes\":{\"enabled\":true,\"created\":1470959478,\"updated\":1470959478}},{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/acfab6b63d00437ea154e25dcf3cc7be\",\"attributes\":{\"enabled\":true,\"created\":1470959468,\"updated\":1470959468}},{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/b2d1af600e894f728c0edd941f787fd1\",\"attributes\":{\"enabled\":true,\"created\":1470959469,\"updated\":1470959469}},{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/c44ee5c410984f579ab17c7c865a2fd1\",\"attributes\":{\"enabled\":true,\"created\":1470959477,\"updated\":1470959477}}],\"nextLink\":null}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '84246ec8-ed87-4a84-95e1-3e929bb10ceb', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:18 GMT', + connection: 'close', + 'content-length': '703' }); + return result; }], +[function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) .post('/keys/nodeKeyforBkp/create?api-version=2015-06-01', '*') - .reply(200, {"key":{"kid":"https://nodesdktest.vault.azure.net/keys/nodeKeyforBkp/265d7f947d6f4f68ae993224f3bb5454","kty":"RSA","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"jP6Dwgnb6jm2UW-V3pUv13-0h6zxxNlXAER0r9iy4e4ZbpUg9Fz7nw8YBqXVmb6kD7uo-M-2VBThjyIgK7aGPJkfu9YGvDdzE0Tc-nk-vptY7Ig9XBbJZrX3zx4FaGUtyR7aMI0zvdqpVMiZ12V1q7lSarmDh3iJB-Lxc7Jp4acnZQWS9y00xC7FlUL20c7iVdfoD-juyJupZrZBUu0_IYp9saZQe0SQNkNdCkeCQG1mEClWvHZaE6GPENSuvts3n7scLCMuOvsWoSmG9umKsjkkASOPfniCsDp8oRL0xb-aSDn7OWGMj3zaCmYOO7ZjEB8PH0qokKuDIak62q6Flw","e":"AQAB"},"attributes":{"enabled":true,"created":1438729195,"updated":1438729195}}, { 'cache-control': 'no-cache', + .reply(200, "{\"key\":{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKeyforBkp/e5ada42c892e4a4e9937ccb4d36c78e7\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"2Q3rHUv6xS8gaQ3krL3GfbuDTjpZ4m2Xh16kAQ26p3sbANXU84Uxs7JPktqCA1Dj3LRFe7tlgjCZfTGm2ZXfNkCJXMgeL8Bu5SINPflPcoE-3VcL3yQBUXkeas7OqXHyhPaqJezvvDffLCUI07YJxYjpKYx8n6jkh-D739-82r9U0g3I1BUYOi3vsowXFyHEU_fMDE8bJ-1MHtbGbKRhG6DrFBELUmnGIqFQ2MQ3WKH14BUIMZyEBkMqH9zLEl4c1hBBN8v8RgwgJUHBOR8fvexYjpDb_NETUv6KlnLR_2H5qCpM5MUOIItbqN003QIBhTdx_RHmMZwxcm5aFb89Rw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1470959479,\"updated\":1470959479}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '050a1fef-0d52-4bca-846a-d76738ecea3c', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 22:59:55 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:19 GMT', connection: 'close', - 'content-length': '623' }); + 'content-length': '624' }); return result; }, function (nock) { var result = -nock('https://nodesdktest.vault.azure.net:443') +nock('https://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) .post('/keys/nodeKeyforBkp/create?api-version=2015-06-01', '*') - .reply(200, {"key":{"kid":"https://nodesdktest.vault.azure.net/keys/nodeKeyforBkp/265d7f947d6f4f68ae993224f3bb5454","kty":"RSA","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"jP6Dwgnb6jm2UW-V3pUv13-0h6zxxNlXAER0r9iy4e4ZbpUg9Fz7nw8YBqXVmb6kD7uo-M-2VBThjyIgK7aGPJkfu9YGvDdzE0Tc-nk-vptY7Ig9XBbJZrX3zx4FaGUtyR7aMI0zvdqpVMiZ12V1q7lSarmDh3iJB-Lxc7Jp4acnZQWS9y00xC7FlUL20c7iVdfoD-juyJupZrZBUu0_IYp9saZQe0SQNkNdCkeCQG1mEClWvHZaE6GPENSuvts3n7scLCMuOvsWoSmG9umKsjkkASOPfniCsDp8oRL0xb-aSDn7OWGMj3zaCmYOO7ZjEB8PH0qokKuDIak62q6Flw","e":"AQAB"},"attributes":{"enabled":true,"created":1438729195,"updated":1438729195}}, { 'cache-control': 'no-cache', + .reply(200, "{\"key\":{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKeyforBkp/e5ada42c892e4a4e9937ccb4d36c78e7\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"2Q3rHUv6xS8gaQ3krL3GfbuDTjpZ4m2Xh16kAQ26p3sbANXU84Uxs7JPktqCA1Dj3LRFe7tlgjCZfTGm2ZXfNkCJXMgeL8Bu5SINPflPcoE-3VcL3yQBUXkeas7OqXHyhPaqJezvvDffLCUI07YJxYjpKYx8n6jkh-D739-82r9U0g3I1BUYOi3vsowXFyHEU_fMDE8bJ-1MHtbGbKRhG6DrFBELUmnGIqFQ2MQ3WKH14BUIMZyEBkMqH9zLEl4c1hBBN8v8RgwgJUHBOR8fvexYjpDb_NETUv6KlnLR_2H5qCpM5MUOIItbqN003QIBhTdx_RHmMZwxcm5aFb89Rw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1470959479,\"updated\":1470959479}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '050a1fef-0d52-4bca-846a-d76738ecea3c', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 22:59:55 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:19 GMT', connection: 'close', - 'content-length': '623' }); + 'content-length': '624' }); return result; }, function (nock) { var result = -nock('http://nodesdktest.vault.azure.net:443') - .filteringRequestBody(function (path) { return '*';}) -.post('/keys/nodeKeyforBkp/backup?api-version=2015-06-01', '*') - .reply(200, {"value":"JkF6dXJlS2V5VmF1bHRLZXlCYWNrdXBWMS5taWNyb3NvZnQuY29tZXlKcmFXUWlPaUkwTXpnMVlqQTNZaTFrTlRRM0xUUXlaVFV0WVdVNVpTMDJNVEJrWXpNNVpHWmhaamdpTENKaGJHY2lPaUpTVTBFdFQwRkZVQ0lzSW1WdVl5STZJa0V4TWpoRFFrTXRTRk15TlRZaWZRLlFCRzZsRmxmNU5kSFRPaW5wTnh6ejZYNWMzQ3gtdFlRUkgwQ0lZMGprWVdkUml1blJZOThyeEthbnFOclpuS19HMThwb0VFYTA3a1BxTXBvQ2JKZzdKdUozVzVfeVExUUlJZEd6ZV9KNnptN0JUbkFZVy1nUUJnaWg4cWRTOGpjc1Y0a3pNaTFsRWd3XzMtNjN6bWp3X3R3SHVhR2tndlNyMC16NjBoSVZwb3BfUUkyZjIxUlhpSVJMOFdpbXNTcXRjQzEwZXRta1BxM1dETDhCQ2lUbG9zeGY4bXd6dkJ5VG9hcERaZEhpM3djOUZTaC1ZNGNuNUlJUUJCUm9WVW9sbGhXOExabWs2Rk1OSnczY1R5dUpyUmVVMU5Ed2dncW4xQjlHeV9TandQd21VZm05NS1IbTVBSy1GYUExa0ltUnB2LXRpU0JHVWF4Mm9wZE1Dc0EyZy5GbVNobU9YQW9JbGVwUTBRSDR6a2ZRLlBRRDctR0d1dVhJMXRqVnM1cHlydEgzTmVkN0RDMmY2aG5zaldKUWQxN1plVnJaQjlERzhyQTczOWstbEFpVURDQVo3UXJfSlNXLWRmVXdtNUhxeDFMcUJ1QlZXQTBkTUZ3Ukl6QXVzM3dSMmZpMzkwNWN1S3VRdGFYN2hxM1NmX0huUnpieEE4QXlrajhjN0lidVZFS3N0VU9vX08tc3NNbjNJUXFkajloQk1XSnR3WTRwRU5wLVBoMmdEdFNiSEJDd2FiZ0Q5MjRfQnJnNW5EdjhrQVV1bU9tSjZPbnZwR3JKdTVRWE9hc1FvQ29FTVh0eVpoQWJabVNGcE9DTjZ1Y0RxTkc2ZjNLeFNlQ1VzX1AzR1l1RzVRVTB2ZVJtV0pkM3ZOeTVfQmpfcTJLa0xpX3R0MGFDM29pQlVxYkljMlZSZUtYVXpYYkNzejV6VHhlNEtVdl9rNF9PMWFHN1lESk9ZWmRLUk1yQTJvNC16elc1UlRhUTJINHRCaGg4dW5xTkJYYnp0cnpURE82RjctSU1ORzI2MEVhWmNNLUhNenVvb0pyUVpycE5PVUJ0ZFQ2NVhUNndva1ZpcVNaamRZNlJCeDNtTVZzb1FGakN2NEgwY2JObURienZ0cHljYlJwSVlqRjB0eE9CVW9ORXZMaEFUSXJnaEc4TkU0TW9iQXJiaV9DMl9pSFlxYWpvOWRDSm5hTnNlRnQxaUVMa0w2b3NzTHRCQ183OWtPV3pVdVJ1Si1ZLUpudmM3UjZJQ1hMdW0xajhKejl2OTJBdU9WRXNxX09BaGE5Ukd4M2RadU9Fb29YSVBQVzJOLVFGNlFoVXIxNVNTd2pTdWZsTE9zLUJnTnFtSVFoQlREYkdILXl5YXVaMmdhb3FqYXF4Zy1GTXNrWTRsdU1QYnpPb0pla0ZXRDVHSnZ5cTNpV3N3WHljeUtDcDU1VEZVZkgyMEcyT3FJeXRTSjRRNVBmSW5FSlBLMnhhTTh4SGs5MTlRSGN3ZGhPSkUyNEFlN1hnZ3BWSkdLSGY3eHJfaUYyWlRzWEYyckNSWHJZWTlCa0lCNkpzSUtQem9CNkFOckVZSWJTT3gzOWpIRU9yQXdxYkRFanQtbzV4aTBvMW9OSmVPNlhQLVByOC13eGZYZl9uSWwzU1BBdUFndVJOTkNUMnVGRENJUl84QnQxaFM5dVR1b25haGMwcWJCMW15ZmRlcVZmcS1QTXBIWGJPanpJelRlOUZkWVF4X3ZCUUR2R3FaME9rQ1RidEdqVE9pMEtncmNMU3B5c3gxdEZYNk15aDlPLXByWWNvMjdZOU9rc0pGZ3hMakdMNDBHY0pva29Hem53NVZrNEYzekZtQmQwbzRsNkp2R2hraU5LWTVZU3ZrMjNXaVZiaFFSUGRmdkJOeXg1MHRuVmc4UWQ5YzJoUmY0MkRNaUowbWZWRV82dU5xdEhnc1p6RzdWTFVPWHg1LXlsM0JCSGxiSlNQSFFGVGZoSE4wdkZDOTJ2RTZzVmN4a0lRNTF4SHRBa016LUZyQnladnJ5cFNUWTRHT3c2eE82UVFoSW05UVdwaFFkU0FRMTFKRmQxUG9ZemFPZUs5eFVpS1I3QkZ6c2ZlTVhTMDVIUWdjRC01eFRscnlpYTBCUWtFRUd1N3RKTm9HQjloN01TSk53Mm5sME1sVndFN095Q3AtQVdxd2FNWG9qRWl3Ulp6ampkLUxDOHZ1d2pyTEZsYzZZV2xrM1otdUxwVms3dWxhLThVeWNKZmtVR3ZVb2MxNXJJVTN5Uk93MVpUOW9xOUhnMEJncUl3Zks4dFJ5WjViejFJRE5NSUtmM2lhcm5ZeVhPc1BEMGFKeVlzdzhTZXJRcTlIaEo1M1M2LVZGMmxhaExJalBLblRSRVVERm11Rms2MzRjRTlYazI4c1IyT0t6STFuTWZKTW9qWHpSdHRKdE50TVRHYkxJZ0oxbUFzZEFqemp3TnByTTlOZkZJV3hKbEFGc2VSQVBoSkY1U3UxREw1NWNSWVFoaEJxeUw4czZBeFFBT1dhcFI0UDhQVkU0Z3ZRTWJCamZ0ekctbzB3LS13dFl6TFBlanh2RlVUSWRpQ1ZZX3BVa2ExdVpMOTdRcXM2X2hEcVhIWWlzZUhvbEd2bnhheWw0V2dpUWR2MXJMLVlRQVF6VkF5NFYtakVTRFNrTHdQYmdQV3NXWDhWblJDMkZKVUtpTGN6MlJJRENrQ2c1TFVvRW5pNkIxS2dvemZLdU4xSTY1VTc5Q1Q1SXBDYUozNndpb2dWWjJESnRsMnd2Vmtkd3NydlFCU3VvWWo3bkF5aGEwenoyR0VVemh0b0ZlZlJtLWxnMEJZY25VSHlvNVJfajRoSmR2dEh4YlVfQVpSa1J1YWVSUU80QWp5cVpCejJrZG5NRlhTVC1OY2xlcnd4Sm1TUThrcHpGVjlnSzhnbTY1ZUVMaGVDeWZnU1lrMDBnU2tabmFrRXRsc1Q3T1Exam9NRWVUbXUxQmhBLTF2XzFRZnY2WEhFeVV1ajNYTEJKZWhwRVlHNXpKUW5xQW1EUmxIZmxMeWZUanYxVVFzNm5iVkJoTDlWQ0F5dFFDeTVjZG42VkFkdDN4bWZIeW5OZFhfSXV0cmM3Yzc4bUk0dHdPZHhXZXUxcGhxSVdIWUlQU21fQXA2U2lSeWJzeVJuZktWNkM4dnN2OWpGbzhyTEp6dFRHQnUzU3YyaTVDU016ZGVsc3Rrd0RhRkpHNjgwUjZibEJEQ0FqU3NtT2xZRTlEY2c4MFkzcFJrWUEyU3dob0FxdHJFS3FpNW9TV3pCV2U0bzNnTWxhY2xfMVJSWVRpNHRtblpVQVF4aExOc2RrNGFMVEtXei1kSW9MRWpCQ2hEcnR0WFFDNUQ4emZ6NUNIX2hWZGxwdmlQdHpSR3hNWlhaZzNBMlNQUGFTQVBla05UaHhNRjgydkc4Ty02TWJESWdiZHczMkltZTNBcE9LZ1NqeWg0MC1icV9YTWJKZk4zMjd1M2FCV0p3c2hnNnE1OEtRN2RkOTdCZXdTSDZwd3lxX1lLSWVabUNTakU0bkNuUkdjZ2F2dmswaXFGMTZ4NXB5c1o0QmNNeUlBUFBnSnN4QWhYcFExREl2SjAtLV9DV3dVXzk3ZXFNNmtxanJ3N3lrR2JmT1NzZk4tM3B0UFJlalZlN0U4bjNxTjhndmNxekVzMm5sRHQzRjhzVnc4OC0zd252Szk1SWU2U2s5N0Q5NWZDWmhCVVVkR2VZdjJMYXZkN1BiNF90ZElBcEJZdzZ5MENCNm16WUlWVUhVenpSSXo2SjJ4UWtoM2pUSkFvZk5PeDdkRFEzUklYRlZtdnpmdUJYNlh3SFVROXFna1g2RzNtQ0hkOElDeG1Pc3diRlgydjBMZjQ5NWdCdTROMHQ2d1lETUxHLW5xN3p2WnFnckYxVEN4bFpldWlHYjNveGpwOTNjdlpOS29MbDdmMkNUblFKMXpHeFROODNzWFQ5dHEzc2wzWHNZelNVbjBxUU5VYnVWT1ZjZUhSdTdPVzV1WXl4b0d5dFhLaWtuMEVnN1NjOV9WVm83WUY3Tnh0ZTY3dU1Sb0pla3pDUU0zejQtUWJCLW1oZUE2bGFvT2NtWHhIbDgtMjlqSWs5UGZVR0VzeUJoaHFKcVQ3UkxIbkZLa1B6czFLNW5wZ0JSN2FzVGdVYS1vQ3RIc2NYZnNFc1JSUmVKY2lWdVVZemFGc2xncExtZjB3d3JBcUx5SmxJTjVzUW5VblJ2UlprTzNER1BPWUdjRWVOek91VFN6X3pQN2N1QkhBcDVpT2ZBd0tmbmFBcHFjQnNoVDRtVWk5aEVtNHk2UXhTRzJQNkJBVzhGRWwtMDczVkVaVUlCamdrem1yVlpnb2VFcDZQaF9ZWGprQzk1TlpUTVlHc0ZCQjdRWmJUaGhHendldkNnbW52cmFidHpvSWpTV2FZemROTi1yeUNjWWNyRXdaX3M4WFd0WHo0R3JNaG14OENQNzZESFl4STk5eWtzUjB0WDNDTUdudVdfVlhPazlfdHFDWU50NFFnVDdXd3hVWFdzLTBEV01WcWVMaVhvYnV0V1JEUXlFdWV2NEFLcFN3VmR1NmV4aGRzakNzNEVqb19XTEZaYUdLYUJNVFU2VEFqakExaGY1VkJ2MHBrMzNqSFZHMmNJek9YQkhWT0xSRTgwWnEzM1ZNT0dnQnF4clNFREVoSzc5Z1d0TlVYSFE2S1Njc0NZNW8wb0Fqc2I0Y3Z4Z19ySmM4bEhoa1pLTkRsWFhvQ3RGR3diTFBEekt5TTRkTjhyTklCbGtjWWUyOHJFZ3VZYXUyX0lnR0lnSVFzMWszTVVYRm4wRkFwVllTRUNwd3Z4elF2aWdYdVVUVVM4cUlxazBuRTQ2MmJwa0F3RlBQWHI2c0Rra2lXMXY5Y3ZrdjNhYmVMMmt1NklnT1NBRmlVOTdCaWkzWHVlQTJ1QU1wRnhKSWlLTGVLNGVHY0FzQV9oX0l0cjlERlFsSVdmeVlfOU0wYTh4VXQ3Vkh5VW9hRTJKQUR6MjcyRTc2LWM3SGJGM0QxdFFXMUlrbWJWRWthSHlqbS1FVmtnZHU1OGpvUG8wbzljS0pLZ1lkZ0ZSNlBTVjBRQi10SDgzSm5FSlctYWJDWHBlWUc1NnRram8xZlN2Ni04U0tTbkhtTlIwN1VTclRQazAyc3ltbkx4Mjd0RWZhaElYU1dKRUhxMjF3NXZtWko4RC00X1lVMG5WT1JHVVBuUmxaUWJCRjdvbmVDcWdHN3pPOEkwMUtfellkOVE4YUZYZ0wzdVQxS2ZTOHRpeEw1YzZ5MjBTbzZSLVdieTc0d2UxRUtRbzJUZVZsUTJOWmQ5UEFIbjBTWF9JZ2RNb2hTRTVqeFdwMlc1Q04tRnRsNlFqRzFNS2tlMTFtT0pmbjNrRFhqMldyeU96c3RJMXNRSTY5TGFtZi1CMEd3cUsxX1gzbEtTM050STZ3OENsa1d2SF81ZWtlTjZ2ZndOcUN6WkxIZHdOR3hDN1RHeDF6WF9aLXVkMEV0OVNfNVdRTG5DcXRqVmJ3TC1TekV4OUVQamxXWEtEODc4SGtsSXVjY21YSHk4RHE4WkFmaFhLS3VTQkJzTmVTQ1UwbnZPUUxYSDdwSkQtQkY3enhnQmV1RnF5NUc1MGhmbkE5dzVpMzNibnk2amlCaV9PQ0RRdEZhNzhVZTFIcnJvYV9Ca0pDMl9VVFBPeV92Y2lZNm01dWpkYlhkYV9HSXFJNzYwajV1ZWw4VkRzQ1hZMlJETGlpb2FVaENYX1Y0NkZDYzd1U2haV0V6VWY0Q2RsLXNJRmJSeGEwVTFNVVBBLWFtSUotc0RvcDdrcWNFeDVOT2tHU2plQUZOVjc3eW1MNzV3OG9XVlVXMk9qTE1KN2RxMS1WUURwb29XeE42T1I2ZGtxVjJ5ZGpwZl9RczhkYlBZVXA5LTdIOHR1cVFkOEk2bDdDX2ZqUlVURng2UVZWMnZNN0p3cXN5OFNBTHpxR18xV3FNZ2VWdlZwcmdpejVsREtHdzY1M252aFNIaXU0TjZobG1pb05nQ3pCYkZnWmRkOFoyX2ZJZVFUQWZVTVcya1dVZ3Y2Y1pzZGtmRzV6Vkt2ejAyRHNldGlDeExwb3ZqejVEVlYyVlhXLVZYT1l5aFJKREFmbWl6ZnpBcWZfZDA5ZzRRMERPX1Vrdm44eHByZGZkX1VFY01Ybk9VTFo0cTd2em5meFJBdHRlM3lOdWoxaGlxNzJRMURVSW1xTXRJOGhiaUg1WTR2ZXF2S25jTGdmbGllTlg2em1OcGxSQWZPWDl4SkVXM052cE5SR2psaHdkUVY4RmlhRE1kUkk1cEFmWEVzREhNRzlpTGhja3A2ZTIxX1RUenJoa1RWcGYtVGYxV0JpN0Fvc1dvblB6VWVaSDBuVXRCV0V2VnZ5TWlNODViZ2F5RUtnRkg0Ri1wS2VIcmN0YWRKeWd2dFctZVZCdUJGdS1SRDZ4Nl9QbU9TaVdJVDdlcjVLOHBCeFlnS2MtZjhmNlVnRjc0Q2E5Vzd2dTlVOXlwUjM1ZF9XbVhrUG9CVC1US05lQTlRZklnZ0c1a2dVMUcwd2JRb2M1VVIwYVo4MVA2YmNJSldoQ1o0VFd6bG9uenRsU3VkWTU2elRIZ1dpbTc5RHhNcm5fbFhsRmF4MU1LRWR4OXozVGVmTE5KVFdkaUhLNDByZVZPZ1dveURNSXIyVktIQlAwUzRNQk1QNTJKN1JKSzFHVDBYVVctUDgyX09TOWZ0c1JVMUg1SllidUZad0owRm9ULUNBVFNBQkw4U2JpZzlBYXZPWkNrclJJREVRNmFBMnIzS2ZBQ2RJVlJGUXdpbWl0c2NrcXRLVkt1c0hnQVNXM1ZtQUJHUzRZVFZCNXItUDlTTW9qZ2diZVVGM0EzdnBNZWV1U1dyVWk1RVhuQjhyN1NKckR1ODVIMEFLT19LLVhYdVBQam9Gb3hzNHNqTnRwOFZ5LThORElKTldQV0ozM0dBWkhxTHVST0hwQ1lPTElkZG91dEdVeW8tQ1ptSjZJQ1g5UWJ5UkQwak1DeUpTTHBUcDBMOWdjY1VReVNWT3NVamFoZlpMVVFpUzhHNFdGdjNjb3lPQXQyeklXQ09Xc0RaMVZrQVdJczFveVdzMVFrRkFPWXZWZU1xdGgxaFJWWTkzSVE4dk1XM0E1RFJOVG05V2tsWTNLOXM5MHllOERsSF9YYmZvVlNrSW5YYVd6aHJVX3d1Nnc0cEpBQ2o0WHJfVTNRWXBQNGlIZDVmVWJrSzJuLWFxMGxZT2JUZWRQb0t3djFraVJ3S1B6cGtQX0ZKWTliekpfQUljNVJIbzFmMXpONkw0ZkZIMk1iQU51RzlyRWgxbEtTMWZpTHYxRmJMamxrdV9kT0tqQm5vWEtVS3l1Q0swQm16Y0hUNVNZbVRoWW0xNnR0cGNzSFRwWkdZT3oxTVg5Nkt2bGM0TElTa1VPVXQySGNBTk9KS2hEb2lsdG5fa3VPcXRlVk41VnhjNC1qdF83Ri1vSThxaWJ6VHY1Rkw0bjFNOHRja0xkZV8zYUtrSmw1S3lyZ2R0RUMtYXpUNEQ4UDdiR2p3Tnh3VUNTX29UUUJTcmJvYjNXSVd4VzhYOElEcEVJZU1Lakw0UWZvVXd3cERhRUJEa2RKLTlKeDU5Ynctc0tyY2NqeXhJWGJDbXJwaXZ0M0xzRFBnVVpkNVNDbE9FTldHQm9uWHpBNi1rZ2M3VHItYXVjd05nTFVRLWRVMmRTLXlNMWpTZndpV2pkLS1JUEVRb2VYRjRuVE1EY0FodWlWOFVXS1hkM24wblJiVnlBdEN1TVhKc1JGNHd4ZjdCR28xZkNjNkVCTENQaXo1VG05ZzVZU25nNHFnYzJtdHNQUzJFN2U5a3l2T2tfNHpFOVpnY2pHa2pCaWM4QzB4alBMQXl0WkZUVE1QUFp1dHpYbndrMnpCYXVIV0otQlZfNTVjaEFCUUNhblZhRVc5WWprWUJtR0FUR0dNRllzUEdhNFBTTE9uemJiQ2hOVVl1dkxmYVNYTDEzbHlxV2RRVURfS1Q3bTg3RWl1M2Ntak1DMkQ1aTU5ak9KNUtUYWZIdklNVG9lRUFMaUYtUGtzU21Jb1JBdnVLOGNpYVN0QUc5bHNDZnoyT05hMEhRQTZHTk81Z1JrcGRsdVFjUzhtODh4c3dyRnRrckFLZ3RUemFOcXJDUmVvdGJwLWYwVkRuRk43bkh3WVVnTTFGaTAxNk1ERmZEM3kyVkFtQVoyMHpFQjk2VzhyWFg1TFJMTWlfd2JEd1dlSmdUMVlQbzY4T2x6djM2VzVYcmhOcjlsRFU2amgzZDFPbVlYcFduazlOTVlJZ1FBYjNXdFl1TC1jbDM1ZTR5c1hNZ29pOGo3d2FiVlV2X0lfS1pfRy01V2EwUkloeXhXYmlmMUFPa1N4VnJ2SXVoM0x0NTdoZEp0ZGVlbUNzcnlCZ0VyRnBmRmpUR3c3NkpnbVBkQ0p5VlNoNUJXajI5eWlQVnE2bmRTeWdaZ0RJcEFUZHFkR3BKQUpEQUZfTEJRbVFydFJqTl9yT0lyNWc0d2Rad243TEFETnAxNkRhSVFWOTNtZE9HMUNwTmVRRWFFal9WWDdvaGhSbENyS0VfcG4tUHVtd2NIVWY5TEUwY2tzb1lGTEZmeVFUMWVldGdaTTlYbGNjQ1ZOSHh3dVFQdnhhcFVxcGxfbG9YSzNyY1Q5VFhiZ0s0M3dqTHU3SGpkOFpEQWJoSXdtSnRRdC1SblRLNkdnZDN3bXFZM25ZRE1hY1A3Vnl1ZXZycjh1Y2d6aGNvTUpXcjcwcFViUzBWSUdSY1IwdWtVR3lhUFdFeEVsTmxEOTFWRUYyUFBXU24zb1lOcVNaUEhZTm5VZlAzMk1hWDViMVlCQnhobTZKbEZOSFdRS0w1UnczTDBKWElDVnRabGsydS1MaWM0SXJxQVJhOWVfcGpPS1Q1OW5HY1Y1OE4tZ0xsSDlDeE5IM1VQeDNtQkx4X2tQXzU4ZzM5WGExWlFBZ3VvWHFSSkE3ODN5MDNpWG9ldkpGSU44WEFCendydlVuSGQ3WG9uWm5Qbjl0TVFrVVNwekVLSkUwcTJWLV9QNjdsUjFDczd6cHE4UXJ2cTJkN1pIUDcxWFRaNEVVdWp2T0NvWUoxcXFON0hMM0xRMzJKZ0x1N1FRQ21sVVY3dWFoeEg4U3JlS25SUkljeXpYZG5PQ21HTFVYR0dUSTVGOWZoajZiNldCdHVDaHRHVGlEWHY2aDQybjUxSFJlR0E3cFd4Vm5xc0ZMaTRid3NIS184RHU5bFRzMWxrQzJUSFp0bnFYZWlBODZCVU1TUmx0amg4UmRfaEZnOHFibnJta05lOS1SZzJaSWhhRnlzQzJqYlBkcFlxaFNPbmhfNU1JVm1mNE8tU1dLZVpPZWFRU1NhbVU5cXdzcjJOQlJiU0tvT3ZTMUtCbnpYZm12aUtwTmJneUxRd1dYZUJCMnZ1TWRxQ3A3NDlTMFEwdWpTQ0JDNjJPODhWUVItSW5BRE9HQXhWRkdhNWZxYkVMaTFnN1p5MkxQS3NNMHVTckZjMjJ4SE5oaEprU0lFMWFGeW4zSmhtbG9jdExNc3dIWGJrVDZyVVlZcVFnNERFdUhkTi1EQmpoVGc1NE43ZVdIUUJ3V1BaNTU5d0dTdmNMZllwa215X2RxTkY4YUdjak11aHhJem9NRUp5X3dHWDhzdUQxaEtZTFlGSkdVY0k5MkJjRHl1ZDduWjBkSFFrb25mY0ttNC1DbEdsWUhpR29FNktfVnlsMHhyNHAwQm5pa1ZjMVlodjgtdWNJUGtncGE2UW52N1RJRXJmQTUzNUhKOVJRLURvWnFzbHF6eWYxaXVBZVNLemx4bTRibVY1V0Y2UWg3Q0wwMzJ0V0F2elU1LXYyV0d6NXI1SHdKWVBzd1B0UW1UYUNkQ0g0VFllODQ0Qy1rbEtkcVhTZGhKR3ZUMzl4aDhfZWVybHIyRE0tbUZZbklxVFlqTVB1S0U1R01QUGd5eXdjeEVKS3N5aXM4SW9HTUY3MUhMaWVwaEo0UVNnS2VESXNWXzhvbFRKdElCd1dxZEZoelBvdk1aMGxTMmZlNmZCejVQMHdJRE5udVktRVNtZEU1eGVCR1FGcUNlQmFtVWxqVDU4dkFYelZ0ak81MnkzYnR4bFpuRklsT2xRM1RFUkpnV1VIdDROa0pSM044OHNOZWo4dUN3SWtmNlhtZ2pvT1dFUDZfTWNtZXJKVkJIRFA2M2Zwb0IzbEh4dlVjQmQxRlZUNzZNNkZBSEdrN3o5WnV1ZDRHR3RDQS1Nc28tWFo1dmJjQmVseUg5NDVJdkp1bXlyZVpGRmhqdy1CR1FVN1VuVm5ROUVmRlBIQTF6aXo5dmxDdnZDRVF5aF9mT2J6aEJmRnd4ODJUSHJ5WS1lbVphcTNPY2RpRl9jbDhPcklIM0lOaEZVQVBVUWk1cHFMdkVTMElYcGZRSWNYTkpwZTczanNoR21GYTdVZ3R0N180NFZ6ZjItMjh6OHNod2UxeGkwUVJZeWpyeER3NnVQbnNwN3UybW9zSHFZUnFJRVhiVk1PNDRhcXhDdjR3QkdrV2FVdUJZU1FfUWdkX3dybFltZlJVUEREVjBoWkxXRlBubzdSc1BkbFhQbk5Eand6STBVQm1SRXY2UTdfN0ptcnExenBGUGY2V2lTejJDdVhSUFlkU1BMWnhRMGtmNUhZZWJ5RTVuRXZlWWlfelZXRmVpd3dRQ1BLZUgzLTBjV01VaUI3UnFEajVFQjE0NVc1MGRjMGhqXzgyVV9lYzF2WkhmdThCZ2QtbDh6SU5WYjdvNFh5X2FZcnVQc1BJQjNTRXdERnAwQUlPUHk4ZWVPUU0xN3VKS0g2bzUtelIzczNKUnUyREVlOXNDaGphdEc0VGJVdFpDVlRhUmRhcXMwTkRQSmU0X3E1R2lWYlY5X2toaWdjZHh1VUJZSTFtekxTWkplR2tJZ0N2XzNCZXRsM1ZwZ2RLN3o0cVB6UXYzMHlXb0FxamxiY3lzUEU4UTl3S3lwdkRvMmRYcEZWbi1lT09MdXZNQ1ZPTEJFRVBzYkE3amFnZHFpRmRMTVNiaHJ2QzRLR1ltRkd4cnczaGJHNlp2YlZsaTRDN0ZuYjFILWwyVEtCdWJoZThRSVE2TDFFWU9adExBaFdmVnVLTTFmbTlyMElfcTBSdmU2VmZsNzFyMmFzejVsRzFnbUV5T3h3cnYtUkphNjh5Vm15VW1MUTY2Sk9qX056cElKWDExaWJuTVFfRk1qRWVUWU9sb2JKX0J1VVQ5V1RRYWNzSVgzQ2JNTVh0UzRtMFNJdHIzbi05blVZY2k1dTdTc0dTLU5pWWI0Y2tHNW1BSGZRLXhIcFhlOXM4MWpaWEUwLS1rZkk1MEgzOHhjbTl0bm9veGhsQldOSTNLcTlKRWpuem5CMlFHdXJtTUVCUHJTajF5MHpDNTVwdk1Da2czcEFKd1VKVkZxYU9YZzV1VnZjbjhfT0plaGV2Yjd4M1NFY2hqeHhTZUt3Y3lHZm5xZlNBT05RYjlSemE0emJQbDQ4Mmd4QzhEV1I0UVp5NmE1TkJmWDVWNEN2bnZJMHVZUUdjcHh2UWg1V0JXMjc0Z3VvTmZnSC1tVVV0N0xKRHpuUjBCUGFEdk1aU1NER0M3Q0dLX1dZU3BUNFpIVE1pVG5zY2dQbjVfOUhBZGRjQlp3UThLb1prcjNVcVl3Um5hdzhoR3loR2syLW1NdXlGRTJxLWF0UlBhMWpqcmhPcFVBZG1vRkx5WjE2ck1ldk91cXZ5ZXp0cEkwN0lDak9IM3pkc3hlSW1EdnhNT3JpZ2RDN2E3cG5ib1B0cktLMm1SX29FcTRLTS1NdmVBZERNLTNYWTNwajNMNU1FV0xQZVJGYmhJcDMwcWxwSDltX01HZHAyX3Jzc0tuZnEwTEhZYy11aFZrVFdzNFRDMDdZTnpFTUhHRU03VEN1ZWNaTjBoNHF1V2FQZXZ1NFY5cE1WT0haOFVTejBXTU5IUTBSUEVfS2o1SFR3blVVeXBUZ2Rad1lNTTludUNNVnI3S3cwM3NXdXVzWFB6eVVFMURYUXdsME5jSVE2TmFlc1BmbGluRzAyTjUydEdkOUE3WTlReURucEJCWWhlLVlHdGxzNENPR3JSTjNNM1M0Rm1FQklYMjBlVXFNNlpHazN1a1FORnFJTF8yNW03QWxBYURuMldhXzhJeTljNXFfeVV3X1htc1E1bHc4QWVveGFkd2FpWVAzaE5abERJd1YzeUtKSDBhM3BLRFpWYWtadzBFaUE0MWxsY21CaXlHa1JKLWJDVWpQQkFRaHNzVmw1X2ZBaUdzaENPcVR5Rlp1MWxrNXVYYThOb1VtTG5zZkU1WjZrRUtXdUU3Q0VTOFZsZG1sU3RTUnM4bEZRc1JBY3VLVjFscFUwUW92Yy55S1hlZU1BT21VaENVQXVlTHNPYXVR"}, { 'cache-control': 'no-cache', +nock('http://sdktestvault0511.vault.azure.net') + .post('/keys/nodeKeyforBkp/backup?api-version=2015-06-01') + .reply(200, "{\"value\":\"JkF6dXJlS2V5VmF1bHRLZXlCYWNrdXBWMS5taWNyb3NvZnQuY29tZXlKcmFXUWlPaUkwTXpnMVlqQTNZaTFrTlRRM0xUUXlaVFV0WVdVNVpTMDJNVEJrWXpNNVpHWmhaamdpTENKaGJHY2lPaUpTVTBFdFQwRkZVQ0lzSW1WdVl5STZJa0V4TWpoRFFrTXRTRk15TlRZaWZRLmdGdDV6OG0zSnpKallfQ1Z5dXdyNy1fUmJLSlZYNmZXUEs5QmhkTDZ4cmhZcUxNVVBhLTZSWUZ4eUtQWG1YYTF2MGt5a2lqYklmTWhFU3BlRlRURTN4RW1OSXpzLUFjNExkLVhOdjdIaEdMc3ZrM0REOVNzbFBSbzdpMmhMYWZkQl9fazJwLVdHVDlKeGhvUEpZR3Zic2o4U045ODh3b2ZNY0dacGJ2RXVISFFBQy14V1lUZE4tdDJvOHpaUTZTcHQ2WVM4eWRQY2lCUHdjWHFBTkU2MWdpRnM3emZTa2dveTNJUjZwdm85bFNjWkcycGp1VU51UzcyN010VFdZbml2Q2lHMG53N1NWcjhVa09zREhXcHJqUy15akFZeTk0d2R0UC1BTlRZZy03elMyRl9vMkVwUUlucTU0UDc2ZWxIN3VUM0ItQ3l4UkthQTZJTzlON0hVQS5MbThKY3lIb0RWanQyM0lCeTVESXdBLlVHbVQwazZKcDRIRklqd1Z5bHhxQ2xydTdzcEFtSEdpM0hQMWZIMXZHcU1aNUdjU3N1cV9iQ0pDUk5zMEpaeGRMaUJsdE1ZZS0za0hJZl9Halg5bmExbUJ6N0dFcVcweklHSzlSa09iU0xMSmo4elRXUHk5cHlVRmR6SWFYN0dQNWU1MW8xdHl0Vk5kT0poNmd6c3FxTzhrclRwZkRFeHh4bkM4b2NWQnRERW5CaGo3bVJQcTRWREJxaEpHeHE4M19HUmhhSmhxRWNaSy01VnhBckV4R3RVQ0x6czNhVVByT0VETk5SZFJ2TF90Rm9uYzBJeFdIalg2NHB5MkkwZXExRmxCTEJadTFGdWhrTWxzaGJiYXdic0VPQklwTUdpVGFQQ21kaDE4WmtVYlNWaXNpSHExZXo1Y3hkQmMxWXFzVzBFdGhpR2xFc284SGxGel80WVFQMHZNNmJ4X1BTZzlKWmY1ZGk1aUt6N2tzLTM5ZGdsejItcloyTmdqSjZQbFpQTmcwYmY5d1NXdC1zUzNiRUFsaXBac29Yc0pYTzlnTEVzQVFkMHRRalN3ZC1FOTdJd0V0eThPNnhSWXZKTG9SeHM4X2lxV2NBcGhkMzdLVjJ5UU53aDlSeUFTckhBdG1vM2c5bkpuZ1VyaHRFMC1sZGJxbGUtcm4tQ09nYkJzTkZpdUtxd0RobExpTk9KM0draUVla1FDMVQ5QTR1UmQzellkelVMYVJtRFNsMWhfdWVNcEhQb2V0M3I5RUlaY0ZmZWJxVnVFdmdNM20yeVNZTk5Hdm1JU2RhQ01sWmJyZU5DWUlIbVpEZFRKMWVOUzVZY05pZ2QyTWFQWkc5TWxRWUxwTFF6XzA2UVNsMmhEVDZJMWZQQ0NSb0RBMGEzTWJvM0FSdlVsSGFydU12MmhNdFlmVXM0LUtZRVBaVmRMU2xEUzd3cThUS3BfdWZvTld5RFRRekhyM0g5aU5LVTdlZWZBMUtCNnl4MFllUUZlUDB0WEhDa0V5ZGFQTkhRUElSZDVrZG52WHdXWFJxSzhyeHFYWUI5QWd5UnJ1djVjNmNweWFxN0NHeWRyTFJUSjlMR1NkS1NtdUNWY3VqWHZFSWl5eHhaNU11azZYaGxDRjhLakFpemczZjJza1NIdm82Z1EzbEhBY0lsM1E4b0VjNVpfUW03V3EwZ3QzR2dnZnlCd2NVN1pnSjdVTE1UNmZaUHM0eEJaX3JsMkEwWHo0SVM1ZVozUGFQb3p3TEM2aWlvTjNfbEhNUGJnYkFMYzJ6TmNoS19zVEtCSEtOYks4STZlVkpVQlhtV0ttWllDM090b2pJMDZNQWhKeTdndjh6dUljY2IzcVQ5WlV1WnBfQmhwNkY1U0tvRkV5QXBTbWFiLWF6MTdKZHdBUUZfemFiTjFCdU85YVEzQkw0OExJdnVJalNkZ3ZOYlljelRMYWVHdTd2TEFnUTJSRU90ZWRGdUMzMjljWDdCQ2lkaHRXSmZZODhKRFA1NkdvMUtTTUVVem5GVmx1cm8yMUFJVlFMMENpTEpaa01Md3F4Zmhhb0hRN2dCbHJIOHhhMGdtbWFNTk1ydldHelR3ejRaZXFacm9HcEtjRTg3QnUza0F2NVE2ZVBYaHdqOEYtRGNvd0dyY01aN05pejA3TklXX2hEeG9UZlJCMVFNOWJuMVdiWjV0OWIzSVRIMTduRDQ3UkFoQ2J1TExqcE4wNGlSWC0xMFpnbDZOUWxNWGE5aEZLMmVmS01FZXB6UWFiNEZGVUxkLUtBcnhscmNMXzhEWWowQ3djZGZac1JOUGFvUXlyNDNYLU0zTVp4bVU4Y0ZCN1ZkLWZyWkdqaGRnU0dLVWdJMjY1TWktRTBReG1kczRQZXRZSHhRRmN0bmtxZEY4SjBFUnpDQWJxQnQ2bWhUMjRhQmNkUEd3aGQ4Y19WRG9HR3E4VkZ4VFBxdF9mU2tHdTUyYXc4STRtbWdOMnc3cmtDMWFhZExsTTc1cUU0SFdkU3pNemtGTjNZM25sMUxzNS1DWlBlVTZWbWYxdVpNV1NoOHR0SmlMOFhtdDVNQUZGX1ZoTzJHTVNVSGRKcXpyOGRHdWV1dmF5bEFmQU5reUp2V3J6c19hYmtNeU5kZ2g5OGxmbnRQeXVHOXdlcGx2YXNaOUNuUGF6Y2gyVzYweXNCODdRR0FOLVhjT2NNTGxhLXhpWWRxVkl6c2MwaFVpQVctd05fWm5ZVEFJTFRVeWNaNDVJM2t2T05Ua1Z2ZzBBVHFoaVl3TXEtZG93NXZFdGtBa1hYc1h3NnNocEhUcUFLR2ZyVXRmcjE3YlpGZFhpYjUtaFNuNHdCZlllaW9Td0NkNlZxQ3VuNld6T1FmX0FBcWd2dFRkbU9hQVp6clZEdXVCZ1JHNHNkMkNwX3dUOUFMZ0xwbkNzZTdrM0FsNFBjMjVMQlQ0R21MOGwtX3FPYUtfVXhRQ3Roc05lNXIwR0xlczdiWHhLT0c1cWxmeWFrbUlTNzMtV0dvR0RkSUh4VXU5a2JVTGdTT0RFNHJlcndsLVFmY3pfRWNQMXlWZWozQzhSWG9scFpZVm1SUW9Xa2JaMmo3QjUwWWp5S1ZlLUYtck1vRnNSYWM1aHk2SUYxZER3M0JBRU9xdEZ4YnRNeVB6d25rMGpoNGUxYWhaeU0wSDlWVjlldjI2X1JGbUt5Yjg5S0JBaHZzeEVHcDJZYzUzT0hSbHFGVEY5V3FWbUliLVlXNDhPQ04wZFNzZWJZd2NEMFNxYlZwRF96TDhtTjZzd3RwbFNGZGhjYWZxMzluZDM3ZG1YNmxnYXhyN3RMTl8yNFpMaDhLdUx4WU9naWxTdE1SUXRyUzFBM2lqTnhjbERwdVRJRlI2MGNuVkdpcHpRLWJVT0F0UEZjMDhhMEhzbGhtRUU1QlJFVW1VZEFIS1IteVN5Q0JTTkZrOXU5NFV2WlNtRGxNS2N0T1RUN1hiSGpjbmdaVUEyRXEwcE1CWjZLMzdHOUxYT2gxX0J2NndyV1U0cEotN1VIR2U1Mk92YjhOT2I2WmlzZWN1bGtVMWtjc2gxRUo3VnZabTRySF9xcEZzV0ROQnhPQjVJdGc4anhwc2ZyaER5WDltT3FiaFpyVUpRa2xHLUVZNEJXVGdTNzdzTGtIZHBSVFJFczhlVnFxVVZydUl4YkJMd1lqNXJ1M0Fnb280ZDA1YkRSMXpld1FtdVlZbGJJVVgyTlNKSVliQjRUUTlsSExIWG94Rm5zdEFpeUU2X2Q5bk9zTDVELWNZUm1weWd1QzJzXzRqZFFlbGd2dm5oVG1lXzlFVFhDT2FQZHF2SUZGMlNQNUFOeFhDMktFdUxtbUxPbV9HaTRIaWhSUXZPdXI0MVY4VzJ4WjVhZ0dzcG96akVMQWcxMUtfWTRfYXRwYnNwalNqZDQ2SGpDc0RvODdSZFhPZklCMF9DdzJwMnhMU1lWLTlMVU5ERmFPZkJiMHV4d2loNzdUYl9USF9mVmZISXlNSHk0X3phQVA5Ym9mX21BeElFb18ycm84bTZ3RUhBTFVFSFJEZTZzYXhKOE9kYmNWcmgwQV9sd2NfYmtrR0hWLWlxUFRjU2s1MnFaeXJSNUtmOG50RmhrVlRvcHRqWDRLQWhBUlgyczhZX25Pd3UzX0FjMjBzNll0c1NCUG1WT2pEVGNOWWxIdUpFX0xtVkNXMmU3TWFseXhBUnVmM3ZVa0dXYjhDTHQ2YWlSR0szS3dFbnQ1MVNHNkplalZJRWl2OExWSlZPT25qVkhDRUhtdlpZX0FNcGYzeHpOZEJZNnRFdnd5RnZlRy1BeEFYdzhZS0w0bkFDMDNqTEdFNWJHMmFpT3d4VVF2cmJTSFg5RHpQMHZtb1pKV2hNbUJabG81eUlleGZsMFBIUTczZ3ZNQmNlQVZ1ZTFQNk8zT2RXaVNsSmN5MUtHcUxlWUFmUDNPLXNpQkFwQThDcTExcy1xal92NWZjZ1hWaTRvWmtaa015YzVFTF9zMS1TSVJQMzA5REdlTl85bkt6SXlUUnZKS0FlX3JQaGdkdXJHVWVEcmMwZzdwSDNYUzJEX0g0MFhrM2MxWDM0TldxU2M2VjUycHZ2aFN6NEdkdkJWaHNfMFhrakpWRF8xT3hVN0dRc0o2S0JrMVdabFJ0cHU2SHhEUUJXUC1tbzI2XzBBZXJZcEdXOHcxSXVMay1BS2dERWwyU0liNWJWT3lFU3RPQlFiSEFQV084d3NoR0RKdXNfTUFJajI1RTM4LUdVV2NWVzZWMnFXYldDNkJJbUpIam0tWnJiVWpvTmtTaVNOdGdPRU13Qi05ak80X2FNanFLTE9GVjRJUlh1YUpEdXJrblNvWThUYUR1cERBRm1tcDgyQVlPQzRTaE9lWTUxQmQ5REFhblhMbXljRXNWOExyS0UtUWpwcmZzU0NfZTg4M3VaZHVLZXlLd2J1amlwM3NmaUZLU2ZtZndfWFp1ekFfVEdPZmM2Q2o1QlJTVVg0emNRVlF2UEZYbS12SmxxZjh1Z29XbEwyZVpUeWZmRGJUTWFPams5U2R2MFkxWmJwTUFIblBpRGhtUEVSMFJTOUVlamhsU2NNNUpqNnU0Yzg4cUtoeVBZbmotOUt4VlBRcG5GM0hteGF5cEw2eGc2YzA5YXRyeXBrU2tsNURDbFROQ2ZJRVliTmlhYk9WbU5KaklSVlZMemVYcVZtaWVmY1RPX2IxcXZ2LThacmh5amF0RnNMOTA3bWxTd3c0MUJEOTc0ZEZwOW5QQ21SenZaS0x2M0VLMUdJcEozQ001d1p4QmV2Z0U5dEx3ckI1WW1FeGs3blAwMTl2al8xV2dFM1FpRjZRUlJSQzZOczEtVFdjdkE4NzRST3hyRFJfS1FHU3FOeVFTeWR2YldZb3M1RG1QSlp4bGV1UFRTMVNyUXg0bDRiZ3VEdXRCMVRRbmVCenpWX2NESGlSUHp6MUZ6TTZMa0xvLTBCTjFBLVlMT21CRGpZcW41TVR2RUF6SDN5OFB4Mk5QMFhsUGFwNk9VUlk4b20wMXAtSG13bHVJQkFya1FXWXhkZlVOblkxU2gtTVZyc01GTjZKQW1rbmhSRTdnc05nYmY2a1BYZHVEWkwtSnU0bkNSUGtFN3RvUnE3dmhwX3VsZkQwbUhNVGJjT09BV3c2YjVUaTh0VTl0clBnOUpkS3BOdXk2ZmplMnZxRzZQcGl4cEZVUGZ2bVp6MXl0X1E4WVRBMEVhc1hqSFNDbWs0Z1hnNUtyREdUWTAtdFJFU3U2T1IzQkFSc3A5YklWZzVoQkVyT1QydXNoWkpudGh0bWRQWHg4NWJfdm0yVXd2cXZHTGlONHJYV3FpNFpmNEZ3RFdsQnRTcmUwS0xhd1I3Qm9GMTlXdHZyWTRhYnp5SllGQlZpSUlMNHJnb3g5NGEwaGY5QzB1OWpMX0tqT2doLW9zUXRwVzBsTWtxSnZwSDhWYmtXbFRjY1BVQzdQckp0WjVxcDR6TFhOblptVng0dUV0TThGT3BLeTBlRDR2aFVnTU9GdGFFZER6M0I0eXFGLWRTb01BcGpZa3pxZkp5bW5URFhIaUZpOFJYN0RHNG1XWTI0RzJJY21wX2ZyU214SjluN3BtZTljMFFseWREa0xkNV9GbXBVVXEwUGRJWTBYQndxbWw1SF9KSm45cnN0eXlYWW1lWi0tWHBzQWNQcTV1ampqMzgyVFhEa19LU1o2XzVUaVhPSUFLRkRaQkhhRjZ2QWJzVEtCaFJuS3N5SWFObElVZkNFSC1DdEdiRVFlNUk3UTBMT3lldjFFM1NfRTFOUlVFeU15RjlUSmVCTm8tSlk4RUNxdU5QRUtXNV9tLXJ5ZllSb2Y0V0xUODRWZUVNd1R3VHJkTTVfUUJiVFdsUWRVWkV4SGJheS1qTjI0SkM1ZkVoVm5oTnYxQ1dfakJlTzFjRVRLU3lFcG5LZUp5WUxLVFgxS1FhUEZRLVlxeU1pcmpaSEJYdU0xaGFMRkhyNlBmbWZlNEpjM2dPVXdMWnQ4WjBlZWdfTnZTdDFRcFBhbDJ4amtoT2FiUy1EcDAtRzlsMm1oczNiYkpWVnJwS3VxNmNhMVM5WWExazdWdGFSTkU0R2ljV0F2VUx1dk1QQm1LcTJLYXYwR2NyakRqM2w4clBvNEM3OUJ2RmozcERkQ2hZaUZMeG5PMzlnaWRZVjVnS1RVQVVOQ3FxTDVObDFUekdQdjJtWEJTODV4eHVOa0hremd5dmtaNFJJVWFqRGtNMDhwU05mZU9hNHdpLW1HMUg5cFFRcThSTFRVNEkzMFZnWHRpWllYZ25EdkJRTy1HVHUtMDI2V1ZnbFJudnU3Rm9hdFpJUFVpNlB3bDVqQUxzQlFsamN6ZzFqYkhpWE8wNjdBT1B0QmFaVVZXZWc2bTVOblZyOWlQdm8wODVwUkN1eEJEMXZJN3pIelNySGFSVGpUUE1MMkpJdUYtZW5uQ2ZBbmY0RThLaGdJTHZrWURSNmtVNG16Z2pDZllOdjRJSkZxU2RUWVJBcFI0QlR3dFdFNzNMb1lBR3c4cl9ZbXI5S3FCTGI2eVEtZkxkTVoyMnpSZUx2NFV5TFozcEhZZENkNms4NENGaFlBZWRTU25Mdzd1ZS1jbkNaWi0yT1k0STR1Nk5XSVNrdmxTZTVtaEwxU05DMy05NWJRRTJDVFlvaW5XX0RhZ01WTGl4dzM3TE9OcFVmSll2d2dxOFV4U25XX00wTEhyX1Z1U0JyYjYyNHRBSUZwbUlNVU1YVEx5dFpXSlFFZjRqWG9KSml5MkRHWjhMSExCelVrTnVFaWJHc1QzWUZBV1QyZGJaV0ZYNURqa3lnUmpiZUh2SjhYTG1DVzlwYmZONTNSQU96VnpvRDQ4cnpVZkNFbW9xVGN1N3YxbVFjd3hMQU5LODZZSFkwb0p2NDZvY3J4ZjlMQW5LcEhCUUVVS2FSU1Rac0ZlYmJfZWNaWGlyclpuelI1T3VfMGpuTGxxS2NGcXhlR2VLWW5ld3EzV2FyN0s0Yk42NXVITE9aZVR6c1NUMGZZQUczRWFYeGRJSzhJRDQxTlcydG5hdnZYVHlTNHRpZjN1THdhdXA0Z2JkR2cxX3pjSWRTczQ4VHRvamtkcVRPY2VRdUJBR29zZUQ5NXlTUGIydmR2TzJNTjRKUUVQQ1ZTeEtPR2ZYR0wxVmpucWxrdG92NlN5bkRVNElfUVFsOWoxQTk2cDJpckJPWE5XYzZHakRRLTdxZ0l4dy1WdGxaT2JRbEVvZlJvUi0teThneEllUmtTZGFhS1VYLUZ0MEZ1WVlxRXNTT2V2TWhRRmRrZTg4V3dpMHZuUHlkN1pQZVBqZGZ1OGFJNVJxUmlyZnIxeXB0OHUzOXhHcElhUDNCcEpNdHR2RlBha1RFbzhCblFkRmxYdDRKUVJsazNRZmZCakUwdlNnRkNKZEJKRGp6STgwaFV1X21pd1hiUkZRM3VKcXRGSkFfTWdqOFZkU1JOT1JPX2ZwRjFEQV9lcVZuRW5kQzdZaUJiUTc5cnVoTzJLajRKRlRRNjhwQVcyRTRQLUZrRklZUlpxcFNFQVd6M1QtcHhkX0VRNVByUEd4T0g3VXk0YVUtQ2d0eTBINTVvZERIOTEtdWdpdGNYMm1fTkJLNUh2eS1EcDI5a1pwVFZBOVBwZ190WUlyQk9hbDZxQ2tsSVMwTk0tYWE0d1E4MVdVOWx6M1pHLVhwLWdDX1pYMl9mX3BMV19LQVdndExLSVBaUUtzaW5rckJEY3BxVXdMcVZKd2N4endRcnctRTAyRVQ5alNBWWRHTzVCMG9XaEFxdW9OVFlTMGVTVEJTRXdSWXNNdS1wLVowSEhhMTJVRzZjUE5NUVp5Ukk1ZmdxM01oS1FnV3BieDVHekpvS3V6UEQydWxiWTVWY3NpMGdCS0VKRkVxVERaOXo4SGhUTU9wSDRITWoxQUJuVlFETXB0eThmUDV0MGp5a1prYW5vcm1TcDFFenVmR0RScGhONFhMT3MzOF84STNnd2Q5REotZUk5OTZqbW9jNk9lRllrLWluMDRRZ0hTR3U0b1JNbGV4Y2lpeHpnTGVxU29vTE9MVFhHYzFrZWFRazhfZXR0OVhNLWhTTmJxOE0tQjNhNjhJVHR5cnIzMkpGbFJFZk4teUZnWmNIelhyOVpCemxNX3hlQXJCTkpmTU9hTlRKb1hOei1yeW5vZkV1eEdFeUJOSFZIeGFtYWNmekRZRHVFejJHUUxaWlB3V21hN293cUFSME5OT3laSDRLYjlta3JBUDVFR2s5S05YRzlNNEJ6ek1ubkh2ZDZfOFFCdXFTcWswLk5VVFRhUXF0QTNLMVR5QUkyRHlyQkE\"}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'd8e0f995-9efc-4277-875e-463638c371e7', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 22:59:57 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:19 GMT', connection: 'close', - 'content-length': '12740' }); + 'content-length': '9071' }); return result; }, function (nock) { var result = -nock('https://nodesdktest.vault.azure.net:443') - .filteringRequestBody(function (path) { return '*';}) -.post('/keys/nodeKeyforBkp/backup?api-version=2015-06-01', '*') - .reply(200, {"value":"JkF6dXJlS2V5VmF1bHRLZXlCYWNrdXBWMS5taWNyb3NvZnQuY29tZXlKcmFXUWlPaUkwTXpnMVlqQTNZaTFrTlRRM0xUUXlaVFV0WVdVNVpTMDJNVEJrWXpNNVpHWmhaamdpTENKaGJHY2lPaUpTVTBFdFQwRkZVQ0lzSW1WdVl5STZJa0V4TWpoRFFrTXRTRk15TlRZaWZRLlFCRzZsRmxmNU5kSFRPaW5wTnh6ejZYNWMzQ3gtdFlRUkgwQ0lZMGprWVdkUml1blJZOThyeEthbnFOclpuS19HMThwb0VFYTA3a1BxTXBvQ2JKZzdKdUozVzVfeVExUUlJZEd6ZV9KNnptN0JUbkFZVy1nUUJnaWg4cWRTOGpjc1Y0a3pNaTFsRWd3XzMtNjN6bWp3X3R3SHVhR2tndlNyMC16NjBoSVZwb3BfUUkyZjIxUlhpSVJMOFdpbXNTcXRjQzEwZXRta1BxM1dETDhCQ2lUbG9zeGY4bXd6dkJ5VG9hcERaZEhpM3djOUZTaC1ZNGNuNUlJUUJCUm9WVW9sbGhXOExabWs2Rk1OSnczY1R5dUpyUmVVMU5Ed2dncW4xQjlHeV9TandQd21VZm05NS1IbTVBSy1GYUExa0ltUnB2LXRpU0JHVWF4Mm9wZE1Dc0EyZy5GbVNobU9YQW9JbGVwUTBRSDR6a2ZRLlBRRDctR0d1dVhJMXRqVnM1cHlydEgzTmVkN0RDMmY2aG5zaldKUWQxN1plVnJaQjlERzhyQTczOWstbEFpVURDQVo3UXJfSlNXLWRmVXdtNUhxeDFMcUJ1QlZXQTBkTUZ3Ukl6QXVzM3dSMmZpMzkwNWN1S3VRdGFYN2hxM1NmX0huUnpieEE4QXlrajhjN0lidVZFS3N0VU9vX08tc3NNbjNJUXFkajloQk1XSnR3WTRwRU5wLVBoMmdEdFNiSEJDd2FiZ0Q5MjRfQnJnNW5EdjhrQVV1bU9tSjZPbnZwR3JKdTVRWE9hc1FvQ29FTVh0eVpoQWJabVNGcE9DTjZ1Y0RxTkc2ZjNLeFNlQ1VzX1AzR1l1RzVRVTB2ZVJtV0pkM3ZOeTVfQmpfcTJLa0xpX3R0MGFDM29pQlVxYkljMlZSZUtYVXpYYkNzejV6VHhlNEtVdl9rNF9PMWFHN1lESk9ZWmRLUk1yQTJvNC16elc1UlRhUTJINHRCaGg4dW5xTkJYYnp0cnpURE82RjctSU1ORzI2MEVhWmNNLUhNenVvb0pyUVpycE5PVUJ0ZFQ2NVhUNndva1ZpcVNaamRZNlJCeDNtTVZzb1FGakN2NEgwY2JObURienZ0cHljYlJwSVlqRjB0eE9CVW9ORXZMaEFUSXJnaEc4TkU0TW9iQXJiaV9DMl9pSFlxYWpvOWRDSm5hTnNlRnQxaUVMa0w2b3NzTHRCQ183OWtPV3pVdVJ1Si1ZLUpudmM3UjZJQ1hMdW0xajhKejl2OTJBdU9WRXNxX09BaGE5Ukd4M2RadU9Fb29YSVBQVzJOLVFGNlFoVXIxNVNTd2pTdWZsTE9zLUJnTnFtSVFoQlREYkdILXl5YXVaMmdhb3FqYXF4Zy1GTXNrWTRsdU1QYnpPb0pla0ZXRDVHSnZ5cTNpV3N3WHljeUtDcDU1VEZVZkgyMEcyT3FJeXRTSjRRNVBmSW5FSlBLMnhhTTh4SGs5MTlRSGN3ZGhPSkUyNEFlN1hnZ3BWSkdLSGY3eHJfaUYyWlRzWEYyckNSWHJZWTlCa0lCNkpzSUtQem9CNkFOckVZSWJTT3gzOWpIRU9yQXdxYkRFanQtbzV4aTBvMW9OSmVPNlhQLVByOC13eGZYZl9uSWwzU1BBdUFndVJOTkNUMnVGRENJUl84QnQxaFM5dVR1b25haGMwcWJCMW15ZmRlcVZmcS1QTXBIWGJPanpJelRlOUZkWVF4X3ZCUUR2R3FaME9rQ1RidEdqVE9pMEtncmNMU3B5c3gxdEZYNk15aDlPLXByWWNvMjdZOU9rc0pGZ3hMakdMNDBHY0pva29Hem53NVZrNEYzekZtQmQwbzRsNkp2R2hraU5LWTVZU3ZrMjNXaVZiaFFSUGRmdkJOeXg1MHRuVmc4UWQ5YzJoUmY0MkRNaUowbWZWRV82dU5xdEhnc1p6RzdWTFVPWHg1LXlsM0JCSGxiSlNQSFFGVGZoSE4wdkZDOTJ2RTZzVmN4a0lRNTF4SHRBa016LUZyQnladnJ5cFNUWTRHT3c2eE82UVFoSW05UVdwaFFkU0FRMTFKRmQxUG9ZemFPZUs5eFVpS1I3QkZ6c2ZlTVhTMDVIUWdjRC01eFRscnlpYTBCUWtFRUd1N3RKTm9HQjloN01TSk53Mm5sME1sVndFN095Q3AtQVdxd2FNWG9qRWl3Ulp6ampkLUxDOHZ1d2pyTEZsYzZZV2xrM1otdUxwVms3dWxhLThVeWNKZmtVR3ZVb2MxNXJJVTN5Uk93MVpUOW9xOUhnMEJncUl3Zks4dFJ5WjViejFJRE5NSUtmM2lhcm5ZeVhPc1BEMGFKeVlzdzhTZXJRcTlIaEo1M1M2LVZGMmxhaExJalBLblRSRVVERm11Rms2MzRjRTlYazI4c1IyT0t6STFuTWZKTW9qWHpSdHRKdE50TVRHYkxJZ0oxbUFzZEFqemp3TnByTTlOZkZJV3hKbEFGc2VSQVBoSkY1U3UxREw1NWNSWVFoaEJxeUw4czZBeFFBT1dhcFI0UDhQVkU0Z3ZRTWJCamZ0ekctbzB3LS13dFl6TFBlanh2RlVUSWRpQ1ZZX3BVa2ExdVpMOTdRcXM2X2hEcVhIWWlzZUhvbEd2bnhheWw0V2dpUWR2MXJMLVlRQVF6VkF5NFYtakVTRFNrTHdQYmdQV3NXWDhWblJDMkZKVUtpTGN6MlJJRENrQ2c1TFVvRW5pNkIxS2dvemZLdU4xSTY1VTc5Q1Q1SXBDYUozNndpb2dWWjJESnRsMnd2Vmtkd3NydlFCU3VvWWo3bkF5aGEwenoyR0VVemh0b0ZlZlJtLWxnMEJZY25VSHlvNVJfajRoSmR2dEh4YlVfQVpSa1J1YWVSUU80QWp5cVpCejJrZG5NRlhTVC1OY2xlcnd4Sm1TUThrcHpGVjlnSzhnbTY1ZUVMaGVDeWZnU1lrMDBnU2tabmFrRXRsc1Q3T1Exam9NRWVUbXUxQmhBLTF2XzFRZnY2WEhFeVV1ajNYTEJKZWhwRVlHNXpKUW5xQW1EUmxIZmxMeWZUanYxVVFzNm5iVkJoTDlWQ0F5dFFDeTVjZG42VkFkdDN4bWZIeW5OZFhfSXV0cmM3Yzc4bUk0dHdPZHhXZXUxcGhxSVdIWUlQU21fQXA2U2lSeWJzeVJuZktWNkM4dnN2OWpGbzhyTEp6dFRHQnUzU3YyaTVDU016ZGVsc3Rrd0RhRkpHNjgwUjZibEJEQ0FqU3NtT2xZRTlEY2c4MFkzcFJrWUEyU3dob0FxdHJFS3FpNW9TV3pCV2U0bzNnTWxhY2xfMVJSWVRpNHRtblpVQVF4aExOc2RrNGFMVEtXei1kSW9MRWpCQ2hEcnR0WFFDNUQ4emZ6NUNIX2hWZGxwdmlQdHpSR3hNWlhaZzNBMlNQUGFTQVBla05UaHhNRjgydkc4Ty02TWJESWdiZHczMkltZTNBcE9LZ1NqeWg0MC1icV9YTWJKZk4zMjd1M2FCV0p3c2hnNnE1OEtRN2RkOTdCZXdTSDZwd3lxX1lLSWVabUNTakU0bkNuUkdjZ2F2dmswaXFGMTZ4NXB5c1o0QmNNeUlBUFBnSnN4QWhYcFExREl2SjAtLV9DV3dVXzk3ZXFNNmtxanJ3N3lrR2JmT1NzZk4tM3B0UFJlalZlN0U4bjNxTjhndmNxekVzMm5sRHQzRjhzVnc4OC0zd252Szk1SWU2U2s5N0Q5NWZDWmhCVVVkR2VZdjJMYXZkN1BiNF90ZElBcEJZdzZ5MENCNm16WUlWVUhVenpSSXo2SjJ4UWtoM2pUSkFvZk5PeDdkRFEzUklYRlZtdnpmdUJYNlh3SFVROXFna1g2RzNtQ0hkOElDeG1Pc3diRlgydjBMZjQ5NWdCdTROMHQ2d1lETUxHLW5xN3p2WnFnckYxVEN4bFpldWlHYjNveGpwOTNjdlpOS29MbDdmMkNUblFKMXpHeFROODNzWFQ5dHEzc2wzWHNZelNVbjBxUU5VYnVWT1ZjZUhSdTdPVzV1WXl4b0d5dFhLaWtuMEVnN1NjOV9WVm83WUY3Tnh0ZTY3dU1Sb0pla3pDUU0zejQtUWJCLW1oZUE2bGFvT2NtWHhIbDgtMjlqSWs5UGZVR0VzeUJoaHFKcVQ3UkxIbkZLa1B6czFLNW5wZ0JSN2FzVGdVYS1vQ3RIc2NYZnNFc1JSUmVKY2lWdVVZemFGc2xncExtZjB3d3JBcUx5SmxJTjVzUW5VblJ2UlprTzNER1BPWUdjRWVOek91VFN6X3pQN2N1QkhBcDVpT2ZBd0tmbmFBcHFjQnNoVDRtVWk5aEVtNHk2UXhTRzJQNkJBVzhGRWwtMDczVkVaVUlCamdrem1yVlpnb2VFcDZQaF9ZWGprQzk1TlpUTVlHc0ZCQjdRWmJUaGhHendldkNnbW52cmFidHpvSWpTV2FZemROTi1yeUNjWWNyRXdaX3M4WFd0WHo0R3JNaG14OENQNzZESFl4STk5eWtzUjB0WDNDTUdudVdfVlhPazlfdHFDWU50NFFnVDdXd3hVWFdzLTBEV01WcWVMaVhvYnV0V1JEUXlFdWV2NEFLcFN3VmR1NmV4aGRzakNzNEVqb19XTEZaYUdLYUJNVFU2VEFqakExaGY1VkJ2MHBrMzNqSFZHMmNJek9YQkhWT0xSRTgwWnEzM1ZNT0dnQnF4clNFREVoSzc5Z1d0TlVYSFE2S1Njc0NZNW8wb0Fqc2I0Y3Z4Z19ySmM4bEhoa1pLTkRsWFhvQ3RGR3diTFBEekt5TTRkTjhyTklCbGtjWWUyOHJFZ3VZYXUyX0lnR0lnSVFzMWszTVVYRm4wRkFwVllTRUNwd3Z4elF2aWdYdVVUVVM4cUlxazBuRTQ2MmJwa0F3RlBQWHI2c0Rra2lXMXY5Y3ZrdjNhYmVMMmt1NklnT1NBRmlVOTdCaWkzWHVlQTJ1QU1wRnhKSWlLTGVLNGVHY0FzQV9oX0l0cjlERlFsSVdmeVlfOU0wYTh4VXQ3Vkh5VW9hRTJKQUR6MjcyRTc2LWM3SGJGM0QxdFFXMUlrbWJWRWthSHlqbS1FVmtnZHU1OGpvUG8wbzljS0pLZ1lkZ0ZSNlBTVjBRQi10SDgzSm5FSlctYWJDWHBlWUc1NnRram8xZlN2Ni04U0tTbkhtTlIwN1VTclRQazAyc3ltbkx4Mjd0RWZhaElYU1dKRUhxMjF3NXZtWko4RC00X1lVMG5WT1JHVVBuUmxaUWJCRjdvbmVDcWdHN3pPOEkwMUtfellkOVE4YUZYZ0wzdVQxS2ZTOHRpeEw1YzZ5MjBTbzZSLVdieTc0d2UxRUtRbzJUZVZsUTJOWmQ5UEFIbjBTWF9JZ2RNb2hTRTVqeFdwMlc1Q04tRnRsNlFqRzFNS2tlMTFtT0pmbjNrRFhqMldyeU96c3RJMXNRSTY5TGFtZi1CMEd3cUsxX1gzbEtTM050STZ3OENsa1d2SF81ZWtlTjZ2ZndOcUN6WkxIZHdOR3hDN1RHeDF6WF9aLXVkMEV0OVNfNVdRTG5DcXRqVmJ3TC1TekV4OUVQamxXWEtEODc4SGtsSXVjY21YSHk4RHE4WkFmaFhLS3VTQkJzTmVTQ1UwbnZPUUxYSDdwSkQtQkY3enhnQmV1RnF5NUc1MGhmbkE5dzVpMzNibnk2amlCaV9PQ0RRdEZhNzhVZTFIcnJvYV9Ca0pDMl9VVFBPeV92Y2lZNm01dWpkYlhkYV9HSXFJNzYwajV1ZWw4VkRzQ1hZMlJETGlpb2FVaENYX1Y0NkZDYzd1U2haV0V6VWY0Q2RsLXNJRmJSeGEwVTFNVVBBLWFtSUotc0RvcDdrcWNFeDVOT2tHU2plQUZOVjc3eW1MNzV3OG9XVlVXMk9qTE1KN2RxMS1WUURwb29XeE42T1I2ZGtxVjJ5ZGpwZl9RczhkYlBZVXA5LTdIOHR1cVFkOEk2bDdDX2ZqUlVURng2UVZWMnZNN0p3cXN5OFNBTHpxR18xV3FNZ2VWdlZwcmdpejVsREtHdzY1M252aFNIaXU0TjZobG1pb05nQ3pCYkZnWmRkOFoyX2ZJZVFUQWZVTVcya1dVZ3Y2Y1pzZGtmRzV6Vkt2ejAyRHNldGlDeExwb3ZqejVEVlYyVlhXLVZYT1l5aFJKREFmbWl6ZnpBcWZfZDA5ZzRRMERPX1Vrdm44eHByZGZkX1VFY01Ybk9VTFo0cTd2em5meFJBdHRlM3lOdWoxaGlxNzJRMURVSW1xTXRJOGhiaUg1WTR2ZXF2S25jTGdmbGllTlg2em1OcGxSQWZPWDl4SkVXM052cE5SR2psaHdkUVY4RmlhRE1kUkk1cEFmWEVzREhNRzlpTGhja3A2ZTIxX1RUenJoa1RWcGYtVGYxV0JpN0Fvc1dvblB6VWVaSDBuVXRCV0V2VnZ5TWlNODViZ2F5RUtnRkg0Ri1wS2VIcmN0YWRKeWd2dFctZVZCdUJGdS1SRDZ4Nl9QbU9TaVdJVDdlcjVLOHBCeFlnS2MtZjhmNlVnRjc0Q2E5Vzd2dTlVOXlwUjM1ZF9XbVhrUG9CVC1US05lQTlRZklnZ0c1a2dVMUcwd2JRb2M1VVIwYVo4MVA2YmNJSldoQ1o0VFd6bG9uenRsU3VkWTU2elRIZ1dpbTc5RHhNcm5fbFhsRmF4MU1LRWR4OXozVGVmTE5KVFdkaUhLNDByZVZPZ1dveURNSXIyVktIQlAwUzRNQk1QNTJKN1JKSzFHVDBYVVctUDgyX09TOWZ0c1JVMUg1SllidUZad0owRm9ULUNBVFNBQkw4U2JpZzlBYXZPWkNrclJJREVRNmFBMnIzS2ZBQ2RJVlJGUXdpbWl0c2NrcXRLVkt1c0hnQVNXM1ZtQUJHUzRZVFZCNXItUDlTTW9qZ2diZVVGM0EzdnBNZWV1U1dyVWk1RVhuQjhyN1NKckR1ODVIMEFLT19LLVhYdVBQam9Gb3hzNHNqTnRwOFZ5LThORElKTldQV0ozM0dBWkhxTHVST0hwQ1lPTElkZG91dEdVeW8tQ1ptSjZJQ1g5UWJ5UkQwak1DeUpTTHBUcDBMOWdjY1VReVNWT3NVamFoZlpMVVFpUzhHNFdGdjNjb3lPQXQyeklXQ09Xc0RaMVZrQVdJczFveVdzMVFrRkFPWXZWZU1xdGgxaFJWWTkzSVE4dk1XM0E1RFJOVG05V2tsWTNLOXM5MHllOERsSF9YYmZvVlNrSW5YYVd6aHJVX3d1Nnc0cEpBQ2o0WHJfVTNRWXBQNGlIZDVmVWJrSzJuLWFxMGxZT2JUZWRQb0t3djFraVJ3S1B6cGtQX0ZKWTliekpfQUljNVJIbzFmMXpONkw0ZkZIMk1iQU51RzlyRWgxbEtTMWZpTHYxRmJMamxrdV9kT0tqQm5vWEtVS3l1Q0swQm16Y0hUNVNZbVRoWW0xNnR0cGNzSFRwWkdZT3oxTVg5Nkt2bGM0TElTa1VPVXQySGNBTk9KS2hEb2lsdG5fa3VPcXRlVk41VnhjNC1qdF83Ri1vSThxaWJ6VHY1Rkw0bjFNOHRja0xkZV8zYUtrSmw1S3lyZ2R0RUMtYXpUNEQ4UDdiR2p3Tnh3VUNTX29UUUJTcmJvYjNXSVd4VzhYOElEcEVJZU1Lakw0UWZvVXd3cERhRUJEa2RKLTlKeDU5Ynctc0tyY2NqeXhJWGJDbXJwaXZ0M0xzRFBnVVpkNVNDbE9FTldHQm9uWHpBNi1rZ2M3VHItYXVjd05nTFVRLWRVMmRTLXlNMWpTZndpV2pkLS1JUEVRb2VYRjRuVE1EY0FodWlWOFVXS1hkM24wblJiVnlBdEN1TVhKc1JGNHd4ZjdCR28xZkNjNkVCTENQaXo1VG05ZzVZU25nNHFnYzJtdHNQUzJFN2U5a3l2T2tfNHpFOVpnY2pHa2pCaWM4QzB4alBMQXl0WkZUVE1QUFp1dHpYbndrMnpCYXVIV0otQlZfNTVjaEFCUUNhblZhRVc5WWprWUJtR0FUR0dNRllzUEdhNFBTTE9uemJiQ2hOVVl1dkxmYVNYTDEzbHlxV2RRVURfS1Q3bTg3RWl1M2Ntak1DMkQ1aTU5ak9KNUtUYWZIdklNVG9lRUFMaUYtUGtzU21Jb1JBdnVLOGNpYVN0QUc5bHNDZnoyT05hMEhRQTZHTk81Z1JrcGRsdVFjUzhtODh4c3dyRnRrckFLZ3RUemFOcXJDUmVvdGJwLWYwVkRuRk43bkh3WVVnTTFGaTAxNk1ERmZEM3kyVkFtQVoyMHpFQjk2VzhyWFg1TFJMTWlfd2JEd1dlSmdUMVlQbzY4T2x6djM2VzVYcmhOcjlsRFU2amgzZDFPbVlYcFduazlOTVlJZ1FBYjNXdFl1TC1jbDM1ZTR5c1hNZ29pOGo3d2FiVlV2X0lfS1pfRy01V2EwUkloeXhXYmlmMUFPa1N4VnJ2SXVoM0x0NTdoZEp0ZGVlbUNzcnlCZ0VyRnBmRmpUR3c3NkpnbVBkQ0p5VlNoNUJXajI5eWlQVnE2bmRTeWdaZ0RJcEFUZHFkR3BKQUpEQUZfTEJRbVFydFJqTl9yT0lyNWc0d2Rad243TEFETnAxNkRhSVFWOTNtZE9HMUNwTmVRRWFFal9WWDdvaGhSbENyS0VfcG4tUHVtd2NIVWY5TEUwY2tzb1lGTEZmeVFUMWVldGdaTTlYbGNjQ1ZOSHh3dVFQdnhhcFVxcGxfbG9YSzNyY1Q5VFhiZ0s0M3dqTHU3SGpkOFpEQWJoSXdtSnRRdC1SblRLNkdnZDN3bXFZM25ZRE1hY1A3Vnl1ZXZycjh1Y2d6aGNvTUpXcjcwcFViUzBWSUdSY1IwdWtVR3lhUFdFeEVsTmxEOTFWRUYyUFBXU24zb1lOcVNaUEhZTm5VZlAzMk1hWDViMVlCQnhobTZKbEZOSFdRS0w1UnczTDBKWElDVnRabGsydS1MaWM0SXJxQVJhOWVfcGpPS1Q1OW5HY1Y1OE4tZ0xsSDlDeE5IM1VQeDNtQkx4X2tQXzU4ZzM5WGExWlFBZ3VvWHFSSkE3ODN5MDNpWG9ldkpGSU44WEFCendydlVuSGQ3WG9uWm5Qbjl0TVFrVVNwekVLSkUwcTJWLV9QNjdsUjFDczd6cHE4UXJ2cTJkN1pIUDcxWFRaNEVVdWp2T0NvWUoxcXFON0hMM0xRMzJKZ0x1N1FRQ21sVVY3dWFoeEg4U3JlS25SUkljeXpYZG5PQ21HTFVYR0dUSTVGOWZoajZiNldCdHVDaHRHVGlEWHY2aDQybjUxSFJlR0E3cFd4Vm5xc0ZMaTRid3NIS184RHU5bFRzMWxrQzJUSFp0bnFYZWlBODZCVU1TUmx0amg4UmRfaEZnOHFibnJta05lOS1SZzJaSWhhRnlzQzJqYlBkcFlxaFNPbmhfNU1JVm1mNE8tU1dLZVpPZWFRU1NhbVU5cXdzcjJOQlJiU0tvT3ZTMUtCbnpYZm12aUtwTmJneUxRd1dYZUJCMnZ1TWRxQ3A3NDlTMFEwdWpTQ0JDNjJPODhWUVItSW5BRE9HQXhWRkdhNWZxYkVMaTFnN1p5MkxQS3NNMHVTckZjMjJ4SE5oaEprU0lFMWFGeW4zSmhtbG9jdExNc3dIWGJrVDZyVVlZcVFnNERFdUhkTi1EQmpoVGc1NE43ZVdIUUJ3V1BaNTU5d0dTdmNMZllwa215X2RxTkY4YUdjak11aHhJem9NRUp5X3dHWDhzdUQxaEtZTFlGSkdVY0k5MkJjRHl1ZDduWjBkSFFrb25mY0ttNC1DbEdsWUhpR29FNktfVnlsMHhyNHAwQm5pa1ZjMVlodjgtdWNJUGtncGE2UW52N1RJRXJmQTUzNUhKOVJRLURvWnFzbHF6eWYxaXVBZVNLemx4bTRibVY1V0Y2UWg3Q0wwMzJ0V0F2elU1LXYyV0d6NXI1SHdKWVBzd1B0UW1UYUNkQ0g0VFllODQ0Qy1rbEtkcVhTZGhKR3ZUMzl4aDhfZWVybHIyRE0tbUZZbklxVFlqTVB1S0U1R01QUGd5eXdjeEVKS3N5aXM4SW9HTUY3MUhMaWVwaEo0UVNnS2VESXNWXzhvbFRKdElCd1dxZEZoelBvdk1aMGxTMmZlNmZCejVQMHdJRE5udVktRVNtZEU1eGVCR1FGcUNlQmFtVWxqVDU4dkFYelZ0ak81MnkzYnR4bFpuRklsT2xRM1RFUkpnV1VIdDROa0pSM044OHNOZWo4dUN3SWtmNlhtZ2pvT1dFUDZfTWNtZXJKVkJIRFA2M2Zwb0IzbEh4dlVjQmQxRlZUNzZNNkZBSEdrN3o5WnV1ZDRHR3RDQS1Nc28tWFo1dmJjQmVseUg5NDVJdkp1bXlyZVpGRmhqdy1CR1FVN1VuVm5ROUVmRlBIQTF6aXo5dmxDdnZDRVF5aF9mT2J6aEJmRnd4ODJUSHJ5WS1lbVphcTNPY2RpRl9jbDhPcklIM0lOaEZVQVBVUWk1cHFMdkVTMElYcGZRSWNYTkpwZTczanNoR21GYTdVZ3R0N180NFZ6ZjItMjh6OHNod2UxeGkwUVJZeWpyeER3NnVQbnNwN3UybW9zSHFZUnFJRVhiVk1PNDRhcXhDdjR3QkdrV2FVdUJZU1FfUWdkX3dybFltZlJVUEREVjBoWkxXRlBubzdSc1BkbFhQbk5Eand6STBVQm1SRXY2UTdfN0ptcnExenBGUGY2V2lTejJDdVhSUFlkU1BMWnhRMGtmNUhZZWJ5RTVuRXZlWWlfelZXRmVpd3dRQ1BLZUgzLTBjV01VaUI3UnFEajVFQjE0NVc1MGRjMGhqXzgyVV9lYzF2WkhmdThCZ2QtbDh6SU5WYjdvNFh5X2FZcnVQc1BJQjNTRXdERnAwQUlPUHk4ZWVPUU0xN3VKS0g2bzUtelIzczNKUnUyREVlOXNDaGphdEc0VGJVdFpDVlRhUmRhcXMwTkRQSmU0X3E1R2lWYlY5X2toaWdjZHh1VUJZSTFtekxTWkplR2tJZ0N2XzNCZXRsM1ZwZ2RLN3o0cVB6UXYzMHlXb0FxamxiY3lzUEU4UTl3S3lwdkRvMmRYcEZWbi1lT09MdXZNQ1ZPTEJFRVBzYkE3amFnZHFpRmRMTVNiaHJ2QzRLR1ltRkd4cnczaGJHNlp2YlZsaTRDN0ZuYjFILWwyVEtCdWJoZThRSVE2TDFFWU9adExBaFdmVnVLTTFmbTlyMElfcTBSdmU2VmZsNzFyMmFzejVsRzFnbUV5T3h3cnYtUkphNjh5Vm15VW1MUTY2Sk9qX056cElKWDExaWJuTVFfRk1qRWVUWU9sb2JKX0J1VVQ5V1RRYWNzSVgzQ2JNTVh0UzRtMFNJdHIzbi05blVZY2k1dTdTc0dTLU5pWWI0Y2tHNW1BSGZRLXhIcFhlOXM4MWpaWEUwLS1rZkk1MEgzOHhjbTl0bm9veGhsQldOSTNLcTlKRWpuem5CMlFHdXJtTUVCUHJTajF5MHpDNTVwdk1Da2czcEFKd1VKVkZxYU9YZzV1VnZjbjhfT0plaGV2Yjd4M1NFY2hqeHhTZUt3Y3lHZm5xZlNBT05RYjlSemE0emJQbDQ4Mmd4QzhEV1I0UVp5NmE1TkJmWDVWNEN2bnZJMHVZUUdjcHh2UWg1V0JXMjc0Z3VvTmZnSC1tVVV0N0xKRHpuUjBCUGFEdk1aU1NER0M3Q0dLX1dZU3BUNFpIVE1pVG5zY2dQbjVfOUhBZGRjQlp3UThLb1prcjNVcVl3Um5hdzhoR3loR2syLW1NdXlGRTJxLWF0UlBhMWpqcmhPcFVBZG1vRkx5WjE2ck1ldk91cXZ5ZXp0cEkwN0lDak9IM3pkc3hlSW1EdnhNT3JpZ2RDN2E3cG5ib1B0cktLMm1SX29FcTRLTS1NdmVBZERNLTNYWTNwajNMNU1FV0xQZVJGYmhJcDMwcWxwSDltX01HZHAyX3Jzc0tuZnEwTEhZYy11aFZrVFdzNFRDMDdZTnpFTUhHRU03VEN1ZWNaTjBoNHF1V2FQZXZ1NFY5cE1WT0haOFVTejBXTU5IUTBSUEVfS2o1SFR3blVVeXBUZ2Rad1lNTTludUNNVnI3S3cwM3NXdXVzWFB6eVVFMURYUXdsME5jSVE2TmFlc1BmbGluRzAyTjUydEdkOUE3WTlReURucEJCWWhlLVlHdGxzNENPR3JSTjNNM1M0Rm1FQklYMjBlVXFNNlpHazN1a1FORnFJTF8yNW03QWxBYURuMldhXzhJeTljNXFfeVV3X1htc1E1bHc4QWVveGFkd2FpWVAzaE5abERJd1YzeUtKSDBhM3BLRFpWYWtadzBFaUE0MWxsY21CaXlHa1JKLWJDVWpQQkFRaHNzVmw1X2ZBaUdzaENPcVR5Rlp1MWxrNXVYYThOb1VtTG5zZkU1WjZrRUtXdUU3Q0VTOFZsZG1sU3RTUnM4bEZRc1JBY3VLVjFscFUwUW92Yy55S1hlZU1BT21VaENVQXVlTHNPYXVR"}, { 'cache-control': 'no-cache', +nock('https://sdktestvault0511.vault.azure.net') + .post('/keys/nodeKeyforBkp/backup?api-version=2015-06-01') + .reply(200, "{\"value\":\"JkF6dXJlS2V5VmF1bHRLZXlCYWNrdXBWMS5taWNyb3NvZnQuY29tZXlKcmFXUWlPaUkwTXpnMVlqQTNZaTFrTlRRM0xUUXlaVFV0WVdVNVpTMDJNVEJrWXpNNVpHWmhaamdpTENKaGJHY2lPaUpTVTBFdFQwRkZVQ0lzSW1WdVl5STZJa0V4TWpoRFFrTXRTRk15TlRZaWZRLmdGdDV6OG0zSnpKallfQ1Z5dXdyNy1fUmJLSlZYNmZXUEs5QmhkTDZ4cmhZcUxNVVBhLTZSWUZ4eUtQWG1YYTF2MGt5a2lqYklmTWhFU3BlRlRURTN4RW1OSXpzLUFjNExkLVhOdjdIaEdMc3ZrM0REOVNzbFBSbzdpMmhMYWZkQl9fazJwLVdHVDlKeGhvUEpZR3Zic2o4U045ODh3b2ZNY0dacGJ2RXVISFFBQy14V1lUZE4tdDJvOHpaUTZTcHQ2WVM4eWRQY2lCUHdjWHFBTkU2MWdpRnM3emZTa2dveTNJUjZwdm85bFNjWkcycGp1VU51UzcyN010VFdZbml2Q2lHMG53N1NWcjhVa09zREhXcHJqUy15akFZeTk0d2R0UC1BTlRZZy03elMyRl9vMkVwUUlucTU0UDc2ZWxIN3VUM0ItQ3l4UkthQTZJTzlON0hVQS5MbThKY3lIb0RWanQyM0lCeTVESXdBLlVHbVQwazZKcDRIRklqd1Z5bHhxQ2xydTdzcEFtSEdpM0hQMWZIMXZHcU1aNUdjU3N1cV9iQ0pDUk5zMEpaeGRMaUJsdE1ZZS0za0hJZl9Halg5bmExbUJ6N0dFcVcweklHSzlSa09iU0xMSmo4elRXUHk5cHlVRmR6SWFYN0dQNWU1MW8xdHl0Vk5kT0poNmd6c3FxTzhrclRwZkRFeHh4bkM4b2NWQnRERW5CaGo3bVJQcTRWREJxaEpHeHE4M19HUmhhSmhxRWNaSy01VnhBckV4R3RVQ0x6czNhVVByT0VETk5SZFJ2TF90Rm9uYzBJeFdIalg2NHB5MkkwZXExRmxCTEJadTFGdWhrTWxzaGJiYXdic0VPQklwTUdpVGFQQ21kaDE4WmtVYlNWaXNpSHExZXo1Y3hkQmMxWXFzVzBFdGhpR2xFc284SGxGel80WVFQMHZNNmJ4X1BTZzlKWmY1ZGk1aUt6N2tzLTM5ZGdsejItcloyTmdqSjZQbFpQTmcwYmY5d1NXdC1zUzNiRUFsaXBac29Yc0pYTzlnTEVzQVFkMHRRalN3ZC1FOTdJd0V0eThPNnhSWXZKTG9SeHM4X2lxV2NBcGhkMzdLVjJ5UU53aDlSeUFTckhBdG1vM2c5bkpuZ1VyaHRFMC1sZGJxbGUtcm4tQ09nYkJzTkZpdUtxd0RobExpTk9KM0draUVla1FDMVQ5QTR1UmQzellkelVMYVJtRFNsMWhfdWVNcEhQb2V0M3I5RUlaY0ZmZWJxVnVFdmdNM20yeVNZTk5Hdm1JU2RhQ01sWmJyZU5DWUlIbVpEZFRKMWVOUzVZY05pZ2QyTWFQWkc5TWxRWUxwTFF6XzA2UVNsMmhEVDZJMWZQQ0NSb0RBMGEzTWJvM0FSdlVsSGFydU12MmhNdFlmVXM0LUtZRVBaVmRMU2xEUzd3cThUS3BfdWZvTld5RFRRekhyM0g5aU5LVTdlZWZBMUtCNnl4MFllUUZlUDB0WEhDa0V5ZGFQTkhRUElSZDVrZG52WHdXWFJxSzhyeHFYWUI5QWd5UnJ1djVjNmNweWFxN0NHeWRyTFJUSjlMR1NkS1NtdUNWY3VqWHZFSWl5eHhaNU11azZYaGxDRjhLakFpemczZjJza1NIdm82Z1EzbEhBY0lsM1E4b0VjNVpfUW03V3EwZ3QzR2dnZnlCd2NVN1pnSjdVTE1UNmZaUHM0eEJaX3JsMkEwWHo0SVM1ZVozUGFQb3p3TEM2aWlvTjNfbEhNUGJnYkFMYzJ6TmNoS19zVEtCSEtOYks4STZlVkpVQlhtV0ttWllDM090b2pJMDZNQWhKeTdndjh6dUljY2IzcVQ5WlV1WnBfQmhwNkY1U0tvRkV5QXBTbWFiLWF6MTdKZHdBUUZfemFiTjFCdU85YVEzQkw0OExJdnVJalNkZ3ZOYlljelRMYWVHdTd2TEFnUTJSRU90ZWRGdUMzMjljWDdCQ2lkaHRXSmZZODhKRFA1NkdvMUtTTUVVem5GVmx1cm8yMUFJVlFMMENpTEpaa01Md3F4Zmhhb0hRN2dCbHJIOHhhMGdtbWFNTk1ydldHelR3ejRaZXFacm9HcEtjRTg3QnUza0F2NVE2ZVBYaHdqOEYtRGNvd0dyY01aN05pejA3TklXX2hEeG9UZlJCMVFNOWJuMVdiWjV0OWIzSVRIMTduRDQ3UkFoQ2J1TExqcE4wNGlSWC0xMFpnbDZOUWxNWGE5aEZLMmVmS01FZXB6UWFiNEZGVUxkLUtBcnhscmNMXzhEWWowQ3djZGZac1JOUGFvUXlyNDNYLU0zTVp4bVU4Y0ZCN1ZkLWZyWkdqaGRnU0dLVWdJMjY1TWktRTBReG1kczRQZXRZSHhRRmN0bmtxZEY4SjBFUnpDQWJxQnQ2bWhUMjRhQmNkUEd3aGQ4Y19WRG9HR3E4VkZ4VFBxdF9mU2tHdTUyYXc4STRtbWdOMnc3cmtDMWFhZExsTTc1cUU0SFdkU3pNemtGTjNZM25sMUxzNS1DWlBlVTZWbWYxdVpNV1NoOHR0SmlMOFhtdDVNQUZGX1ZoTzJHTVNVSGRKcXpyOGRHdWV1dmF5bEFmQU5reUp2V3J6c19hYmtNeU5kZ2g5OGxmbnRQeXVHOXdlcGx2YXNaOUNuUGF6Y2gyVzYweXNCODdRR0FOLVhjT2NNTGxhLXhpWWRxVkl6c2MwaFVpQVctd05fWm5ZVEFJTFRVeWNaNDVJM2t2T05Ua1Z2ZzBBVHFoaVl3TXEtZG93NXZFdGtBa1hYc1h3NnNocEhUcUFLR2ZyVXRmcjE3YlpGZFhpYjUtaFNuNHdCZlllaW9Td0NkNlZxQ3VuNld6T1FmX0FBcWd2dFRkbU9hQVp6clZEdXVCZ1JHNHNkMkNwX3dUOUFMZ0xwbkNzZTdrM0FsNFBjMjVMQlQ0R21MOGwtX3FPYUtfVXhRQ3Roc05lNXIwR0xlczdiWHhLT0c1cWxmeWFrbUlTNzMtV0dvR0RkSUh4VXU5a2JVTGdTT0RFNHJlcndsLVFmY3pfRWNQMXlWZWozQzhSWG9scFpZVm1SUW9Xa2JaMmo3QjUwWWp5S1ZlLUYtck1vRnNSYWM1aHk2SUYxZER3M0JBRU9xdEZ4YnRNeVB6d25rMGpoNGUxYWhaeU0wSDlWVjlldjI2X1JGbUt5Yjg5S0JBaHZzeEVHcDJZYzUzT0hSbHFGVEY5V3FWbUliLVlXNDhPQ04wZFNzZWJZd2NEMFNxYlZwRF96TDhtTjZzd3RwbFNGZGhjYWZxMzluZDM3ZG1YNmxnYXhyN3RMTl8yNFpMaDhLdUx4WU9naWxTdE1SUXRyUzFBM2lqTnhjbERwdVRJRlI2MGNuVkdpcHpRLWJVT0F0UEZjMDhhMEhzbGhtRUU1QlJFVW1VZEFIS1IteVN5Q0JTTkZrOXU5NFV2WlNtRGxNS2N0T1RUN1hiSGpjbmdaVUEyRXEwcE1CWjZLMzdHOUxYT2gxX0J2NndyV1U0cEotN1VIR2U1Mk92YjhOT2I2WmlzZWN1bGtVMWtjc2gxRUo3VnZabTRySF9xcEZzV0ROQnhPQjVJdGc4anhwc2ZyaER5WDltT3FiaFpyVUpRa2xHLUVZNEJXVGdTNzdzTGtIZHBSVFJFczhlVnFxVVZydUl4YkJMd1lqNXJ1M0Fnb280ZDA1YkRSMXpld1FtdVlZbGJJVVgyTlNKSVliQjRUUTlsSExIWG94Rm5zdEFpeUU2X2Q5bk9zTDVELWNZUm1weWd1QzJzXzRqZFFlbGd2dm5oVG1lXzlFVFhDT2FQZHF2SUZGMlNQNUFOeFhDMktFdUxtbUxPbV9HaTRIaWhSUXZPdXI0MVY4VzJ4WjVhZ0dzcG96akVMQWcxMUtfWTRfYXRwYnNwalNqZDQ2SGpDc0RvODdSZFhPZklCMF9DdzJwMnhMU1lWLTlMVU5ERmFPZkJiMHV4d2loNzdUYl9USF9mVmZISXlNSHk0X3phQVA5Ym9mX21BeElFb18ycm84bTZ3RUhBTFVFSFJEZTZzYXhKOE9kYmNWcmgwQV9sd2NfYmtrR0hWLWlxUFRjU2s1MnFaeXJSNUtmOG50RmhrVlRvcHRqWDRLQWhBUlgyczhZX25Pd3UzX0FjMjBzNll0c1NCUG1WT2pEVGNOWWxIdUpFX0xtVkNXMmU3TWFseXhBUnVmM3ZVa0dXYjhDTHQ2YWlSR0szS3dFbnQ1MVNHNkplalZJRWl2OExWSlZPT25qVkhDRUhtdlpZX0FNcGYzeHpOZEJZNnRFdnd5RnZlRy1BeEFYdzhZS0w0bkFDMDNqTEdFNWJHMmFpT3d4VVF2cmJTSFg5RHpQMHZtb1pKV2hNbUJabG81eUlleGZsMFBIUTczZ3ZNQmNlQVZ1ZTFQNk8zT2RXaVNsSmN5MUtHcUxlWUFmUDNPLXNpQkFwQThDcTExcy1xal92NWZjZ1hWaTRvWmtaa015YzVFTF9zMS1TSVJQMzA5REdlTl85bkt6SXlUUnZKS0FlX3JQaGdkdXJHVWVEcmMwZzdwSDNYUzJEX0g0MFhrM2MxWDM0TldxU2M2VjUycHZ2aFN6NEdkdkJWaHNfMFhrakpWRF8xT3hVN0dRc0o2S0JrMVdabFJ0cHU2SHhEUUJXUC1tbzI2XzBBZXJZcEdXOHcxSXVMay1BS2dERWwyU0liNWJWT3lFU3RPQlFiSEFQV084d3NoR0RKdXNfTUFJajI1RTM4LUdVV2NWVzZWMnFXYldDNkJJbUpIam0tWnJiVWpvTmtTaVNOdGdPRU13Qi05ak80X2FNanFLTE9GVjRJUlh1YUpEdXJrblNvWThUYUR1cERBRm1tcDgyQVlPQzRTaE9lWTUxQmQ5REFhblhMbXljRXNWOExyS0UtUWpwcmZzU0NfZTg4M3VaZHVLZXlLd2J1amlwM3NmaUZLU2ZtZndfWFp1ekFfVEdPZmM2Q2o1QlJTVVg0emNRVlF2UEZYbS12SmxxZjh1Z29XbEwyZVpUeWZmRGJUTWFPams5U2R2MFkxWmJwTUFIblBpRGhtUEVSMFJTOUVlamhsU2NNNUpqNnU0Yzg4cUtoeVBZbmotOUt4VlBRcG5GM0hteGF5cEw2eGc2YzA5YXRyeXBrU2tsNURDbFROQ2ZJRVliTmlhYk9WbU5KaklSVlZMemVYcVZtaWVmY1RPX2IxcXZ2LThacmh5amF0RnNMOTA3bWxTd3c0MUJEOTc0ZEZwOW5QQ21SenZaS0x2M0VLMUdJcEozQ001d1p4QmV2Z0U5dEx3ckI1WW1FeGs3blAwMTl2al8xV2dFM1FpRjZRUlJSQzZOczEtVFdjdkE4NzRST3hyRFJfS1FHU3FOeVFTeWR2YldZb3M1RG1QSlp4bGV1UFRTMVNyUXg0bDRiZ3VEdXRCMVRRbmVCenpWX2NESGlSUHp6MUZ6TTZMa0xvLTBCTjFBLVlMT21CRGpZcW41TVR2RUF6SDN5OFB4Mk5QMFhsUGFwNk9VUlk4b20wMXAtSG13bHVJQkFya1FXWXhkZlVOblkxU2gtTVZyc01GTjZKQW1rbmhSRTdnc05nYmY2a1BYZHVEWkwtSnU0bkNSUGtFN3RvUnE3dmhwX3VsZkQwbUhNVGJjT09BV3c2YjVUaTh0VTl0clBnOUpkS3BOdXk2ZmplMnZxRzZQcGl4cEZVUGZ2bVp6MXl0X1E4WVRBMEVhc1hqSFNDbWs0Z1hnNUtyREdUWTAtdFJFU3U2T1IzQkFSc3A5YklWZzVoQkVyT1QydXNoWkpudGh0bWRQWHg4NWJfdm0yVXd2cXZHTGlONHJYV3FpNFpmNEZ3RFdsQnRTcmUwS0xhd1I3Qm9GMTlXdHZyWTRhYnp5SllGQlZpSUlMNHJnb3g5NGEwaGY5QzB1OWpMX0tqT2doLW9zUXRwVzBsTWtxSnZwSDhWYmtXbFRjY1BVQzdQckp0WjVxcDR6TFhOblptVng0dUV0TThGT3BLeTBlRDR2aFVnTU9GdGFFZER6M0I0eXFGLWRTb01BcGpZa3pxZkp5bW5URFhIaUZpOFJYN0RHNG1XWTI0RzJJY21wX2ZyU214SjluN3BtZTljMFFseWREa0xkNV9GbXBVVXEwUGRJWTBYQndxbWw1SF9KSm45cnN0eXlYWW1lWi0tWHBzQWNQcTV1ampqMzgyVFhEa19LU1o2XzVUaVhPSUFLRkRaQkhhRjZ2QWJzVEtCaFJuS3N5SWFObElVZkNFSC1DdEdiRVFlNUk3UTBMT3lldjFFM1NfRTFOUlVFeU15RjlUSmVCTm8tSlk4RUNxdU5QRUtXNV9tLXJ5ZllSb2Y0V0xUODRWZUVNd1R3VHJkTTVfUUJiVFdsUWRVWkV4SGJheS1qTjI0SkM1ZkVoVm5oTnYxQ1dfakJlTzFjRVRLU3lFcG5LZUp5WUxLVFgxS1FhUEZRLVlxeU1pcmpaSEJYdU0xaGFMRkhyNlBmbWZlNEpjM2dPVXdMWnQ4WjBlZWdfTnZTdDFRcFBhbDJ4amtoT2FiUy1EcDAtRzlsMm1oczNiYkpWVnJwS3VxNmNhMVM5WWExazdWdGFSTkU0R2ljV0F2VUx1dk1QQm1LcTJLYXYwR2NyakRqM2w4clBvNEM3OUJ2RmozcERkQ2hZaUZMeG5PMzlnaWRZVjVnS1RVQVVOQ3FxTDVObDFUekdQdjJtWEJTODV4eHVOa0hremd5dmtaNFJJVWFqRGtNMDhwU05mZU9hNHdpLW1HMUg5cFFRcThSTFRVNEkzMFZnWHRpWllYZ25EdkJRTy1HVHUtMDI2V1ZnbFJudnU3Rm9hdFpJUFVpNlB3bDVqQUxzQlFsamN6ZzFqYkhpWE8wNjdBT1B0QmFaVVZXZWc2bTVOblZyOWlQdm8wODVwUkN1eEJEMXZJN3pIelNySGFSVGpUUE1MMkpJdUYtZW5uQ2ZBbmY0RThLaGdJTHZrWURSNmtVNG16Z2pDZllOdjRJSkZxU2RUWVJBcFI0QlR3dFdFNzNMb1lBR3c4cl9ZbXI5S3FCTGI2eVEtZkxkTVoyMnpSZUx2NFV5TFozcEhZZENkNms4NENGaFlBZWRTU25Mdzd1ZS1jbkNaWi0yT1k0STR1Nk5XSVNrdmxTZTVtaEwxU05DMy05NWJRRTJDVFlvaW5XX0RhZ01WTGl4dzM3TE9OcFVmSll2d2dxOFV4U25XX00wTEhyX1Z1U0JyYjYyNHRBSUZwbUlNVU1YVEx5dFpXSlFFZjRqWG9KSml5MkRHWjhMSExCelVrTnVFaWJHc1QzWUZBV1QyZGJaV0ZYNURqa3lnUmpiZUh2SjhYTG1DVzlwYmZONTNSQU96VnpvRDQ4cnpVZkNFbW9xVGN1N3YxbVFjd3hMQU5LODZZSFkwb0p2NDZvY3J4ZjlMQW5LcEhCUUVVS2FSU1Rac0ZlYmJfZWNaWGlyclpuelI1T3VfMGpuTGxxS2NGcXhlR2VLWW5ld3EzV2FyN0s0Yk42NXVITE9aZVR6c1NUMGZZQUczRWFYeGRJSzhJRDQxTlcydG5hdnZYVHlTNHRpZjN1THdhdXA0Z2JkR2cxX3pjSWRTczQ4VHRvamtkcVRPY2VRdUJBR29zZUQ5NXlTUGIydmR2TzJNTjRKUUVQQ1ZTeEtPR2ZYR0wxVmpucWxrdG92NlN5bkRVNElfUVFsOWoxQTk2cDJpckJPWE5XYzZHakRRLTdxZ0l4dy1WdGxaT2JRbEVvZlJvUi0teThneEllUmtTZGFhS1VYLUZ0MEZ1WVlxRXNTT2V2TWhRRmRrZTg4V3dpMHZuUHlkN1pQZVBqZGZ1OGFJNVJxUmlyZnIxeXB0OHUzOXhHcElhUDNCcEpNdHR2RlBha1RFbzhCblFkRmxYdDRKUVJsazNRZmZCakUwdlNnRkNKZEJKRGp6STgwaFV1X21pd1hiUkZRM3VKcXRGSkFfTWdqOFZkU1JOT1JPX2ZwRjFEQV9lcVZuRW5kQzdZaUJiUTc5cnVoTzJLajRKRlRRNjhwQVcyRTRQLUZrRklZUlpxcFNFQVd6M1QtcHhkX0VRNVByUEd4T0g3VXk0YVUtQ2d0eTBINTVvZERIOTEtdWdpdGNYMm1fTkJLNUh2eS1EcDI5a1pwVFZBOVBwZ190WUlyQk9hbDZxQ2tsSVMwTk0tYWE0d1E4MVdVOWx6M1pHLVhwLWdDX1pYMl9mX3BMV19LQVdndExLSVBaUUtzaW5rckJEY3BxVXdMcVZKd2N4endRcnctRTAyRVQ5alNBWWRHTzVCMG9XaEFxdW9OVFlTMGVTVEJTRXdSWXNNdS1wLVowSEhhMTJVRzZjUE5NUVp5Ukk1ZmdxM01oS1FnV3BieDVHekpvS3V6UEQydWxiWTVWY3NpMGdCS0VKRkVxVERaOXo4SGhUTU9wSDRITWoxQUJuVlFETXB0eThmUDV0MGp5a1prYW5vcm1TcDFFenVmR0RScGhONFhMT3MzOF84STNnd2Q5REotZUk5OTZqbW9jNk9lRllrLWluMDRRZ0hTR3U0b1JNbGV4Y2lpeHpnTGVxU29vTE9MVFhHYzFrZWFRazhfZXR0OVhNLWhTTmJxOE0tQjNhNjhJVHR5cnIzMkpGbFJFZk4teUZnWmNIelhyOVpCemxNX3hlQXJCTkpmTU9hTlRKb1hOei1yeW5vZkV1eEdFeUJOSFZIeGFtYWNmekRZRHVFejJHUUxaWlB3V21hN293cUFSME5OT3laSDRLYjlta3JBUDVFR2s5S05YRzlNNEJ6ek1ubkh2ZDZfOFFCdXFTcWswLk5VVFRhUXF0QTNLMVR5QUkyRHlyQkE\"}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'd8e0f995-9efc-4277-875e-463638c371e7', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 22:59:57 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:19 GMT', connection: 'close', - 'content-length': '12740' }); + 'content-length': '9071' }); return result; }, function (nock) { var result = -nock('http://nodesdktest.vault.azure.net:443') - .delete('/keys/nodeKeyforBkp/delete?api-version=2015-06-01') - .reply(200, {"key":{"kid":"https://nodesdktest.vault.azure.net/keys/nodeKeyforBkp/265d7f947d6f4f68ae993224f3bb5454","kty":"RSA","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"jP6Dwgnb6jm2UW-V3pUv13-0h6zxxNlXAER0r9iy4e4ZbpUg9Fz7nw8YBqXVmb6kD7uo-M-2VBThjyIgK7aGPJkfu9YGvDdzE0Tc-nk-vptY7Ig9XBbJZrX3zx4FaGUtyR7aMI0zvdqpVMiZ12V1q7lSarmDh3iJB-Lxc7Jp4acnZQWS9y00xC7FlUL20c7iVdfoD-juyJupZrZBUu0_IYp9saZQe0SQNkNdCkeCQG1mEClWvHZaE6GPENSuvts3n7scLCMuOvsWoSmG9umKsjkkASOPfniCsDp8oRL0xb-aSDn7OWGMj3zaCmYOO7ZjEB8PH0qokKuDIak62q6Flw","e":"AQAB"},"attributes":{"enabled":true,"created":1438729195,"updated":1438729195}}, { 'cache-control': 'no-cache', +nock('http://sdktestvault0511.vault.azure.net') + .delete('/keys/nodeKeyforBkp?api-version=2015-06-01') + .reply(200, "{\"key\":{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKeyforBkp/e5ada42c892e4a4e9937ccb4d36c78e7\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"2Q3rHUv6xS8gaQ3krL3GfbuDTjpZ4m2Xh16kAQ26p3sbANXU84Uxs7JPktqCA1Dj3LRFe7tlgjCZfTGm2ZXfNkCJXMgeL8Bu5SINPflPcoE-3VcL3yQBUXkeas7OqXHyhPaqJezvvDffLCUI07YJxYjpKYx8n6jkh-D739-82r9U0g3I1BUYOi3vsowXFyHEU_fMDE8bJ-1MHtbGbKRhG6DrFBELUmnGIqFQ2MQ3WKH14BUIMZyEBkMqH9zLEl4c1hBBN8v8RgwgJUHBOR8fvexYjpDb_NETUv6KlnLR_2H5qCpM5MUOIItbqN003QIBhTdx_RHmMZwxcm5aFb89Rw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1470959479,\"updated\":1470959479}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '588ce293-9747-4a46-b3ff-a2473b3dca38', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 22:59:57 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:21 GMT', connection: 'close', - 'content-length': '623' }); + 'content-length': '624' }); return result; }, function (nock) { var result = -nock('https://nodesdktest.vault.azure.net:443') - .delete('/keys/nodeKeyforBkp/delete?api-version=2015-06-01') - .reply(200, {"key":{"kid":"https://nodesdktest.vault.azure.net/keys/nodeKeyforBkp/265d7f947d6f4f68ae993224f3bb5454","kty":"RSA","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"jP6Dwgnb6jm2UW-V3pUv13-0h6zxxNlXAER0r9iy4e4ZbpUg9Fz7nw8YBqXVmb6kD7uo-M-2VBThjyIgK7aGPJkfu9YGvDdzE0Tc-nk-vptY7Ig9XBbJZrX3zx4FaGUtyR7aMI0zvdqpVMiZ12V1q7lSarmDh3iJB-Lxc7Jp4acnZQWS9y00xC7FlUL20c7iVdfoD-juyJupZrZBUu0_IYp9saZQe0SQNkNdCkeCQG1mEClWvHZaE6GPENSuvts3n7scLCMuOvsWoSmG9umKsjkkASOPfniCsDp8oRL0xb-aSDn7OWGMj3zaCmYOO7ZjEB8PH0qokKuDIak62q6Flw","e":"AQAB"},"attributes":{"enabled":true,"created":1438729195,"updated":1438729195}}, { 'cache-control': 'no-cache', +nock('https://sdktestvault0511.vault.azure.net') + .delete('/keys/nodeKeyforBkp?api-version=2015-06-01') + .reply(200, "{\"key\":{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKeyforBkp/e5ada42c892e4a4e9937ccb4d36c78e7\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"2Q3rHUv6xS8gaQ3krL3GfbuDTjpZ4m2Xh16kAQ26p3sbANXU84Uxs7JPktqCA1Dj3LRFe7tlgjCZfTGm2ZXfNkCJXMgeL8Bu5SINPflPcoE-3VcL3yQBUXkeas7OqXHyhPaqJezvvDffLCUI07YJxYjpKYx8n6jkh-D739-82r9U0g3I1BUYOi3vsowXFyHEU_fMDE8bJ-1MHtbGbKRhG6DrFBELUmnGIqFQ2MQ3WKH14BUIMZyEBkMqH9zLEl4c1hBBN8v8RgwgJUHBOR8fvexYjpDb_NETUv6KlnLR_2H5qCpM5MUOIItbqN003QIBhTdx_RHmMZwxcm5aFb89Rw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1470959479,\"updated\":1470959479}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '588ce293-9747-4a46-b3ff-a2473b3dca38', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 22:59:57 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:21 GMT', connection: 'close', - 'content-length': '623' }); + 'content-length': '624' }); return result; }, function (nock) { var result = -nock('http://nodesdktest.vault.azure.net:443') +nock('http://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) .post('/keys/restore?api-version=2015-06-01', '*') - .reply(200, {"key":{"kid":"https://nodesdktest.vault.azure.net/keys/nodeKeyforBkp/265d7f947d6f4f68ae993224f3bb5454","kty":"RSA","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"jP6Dwgnb6jm2UW-V3pUv13-0h6zxxNlXAER0r9iy4e4ZbpUg9Fz7nw8YBqXVmb6kD7uo-M-2VBThjyIgK7aGPJkfu9YGvDdzE0Tc-nk-vptY7Ig9XBbJZrX3zx4FaGUtyR7aMI0zvdqpVMiZ12V1q7lSarmDh3iJB-Lxc7Jp4acnZQWS9y00xC7FlUL20c7iVdfoD-juyJupZrZBUu0_IYp9saZQe0SQNkNdCkeCQG1mEClWvHZaE6GPENSuvts3n7scLCMuOvsWoSmG9umKsjkkASOPfniCsDp8oRL0xb-aSDn7OWGMj3zaCmYOO7ZjEB8PH0qokKuDIak62q6Flw","e":"AQAB"},"attributes":{"enabled":true,"created":1438729195,"updated":1438729195}}, { 'cache-control': 'no-cache', + .reply(200, "{\"key\":{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKeyforBkp/e5ada42c892e4a4e9937ccb4d36c78e7\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"2Q3rHUv6xS8gaQ3krL3GfbuDTjpZ4m2Xh16kAQ26p3sbANXU84Uxs7JPktqCA1Dj3LRFe7tlgjCZfTGm2ZXfNkCJXMgeL8Bu5SINPflPcoE-3VcL3yQBUXkeas7OqXHyhPaqJezvvDffLCUI07YJxYjpKYx8n6jkh-D739-82r9U0g3I1BUYOi3vsowXFyHEU_fMDE8bJ-1MHtbGbKRhG6DrFBELUmnGIqFQ2MQ3WKH14BUIMZyEBkMqH9zLEl4c1hBBN8v8RgwgJUHBOR8fvexYjpDb_NETUv6KlnLR_2H5qCpM5MUOIItbqN003QIBhTdx_RHmMZwxcm5aFb89Rw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1470959479,\"updated\":1470959479}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'c13bfefc-e3ce-4d09-9d69-e86630ed24fa', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 22:59:57 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:21 GMT', connection: 'close', - 'content-length': '623' }); + 'content-length': '624' }); return result; }, function (nock) { var result = -nock('https://nodesdktest.vault.azure.net:443') +nock('https://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) .post('/keys/restore?api-version=2015-06-01', '*') - .reply(200, {"key":{"kid":"https://nodesdktest.vault.azure.net/keys/nodeKeyforBkp/265d7f947d6f4f68ae993224f3bb5454","kty":"RSA","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"jP6Dwgnb6jm2UW-V3pUv13-0h6zxxNlXAER0r9iy4e4ZbpUg9Fz7nw8YBqXVmb6kD7uo-M-2VBThjyIgK7aGPJkfu9YGvDdzE0Tc-nk-vptY7Ig9XBbJZrX3zx4FaGUtyR7aMI0zvdqpVMiZ12V1q7lSarmDh3iJB-Lxc7Jp4acnZQWS9y00xC7FlUL20c7iVdfoD-juyJupZrZBUu0_IYp9saZQe0SQNkNdCkeCQG1mEClWvHZaE6GPENSuvts3n7scLCMuOvsWoSmG9umKsjkkASOPfniCsDp8oRL0xb-aSDn7OWGMj3zaCmYOO7ZjEB8PH0qokKuDIak62q6Flw","e":"AQAB"},"attributes":{"enabled":true,"created":1438729195,"updated":1438729195}}, { 'cache-control': 'no-cache', + .reply(200, "{\"key\":{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKeyforBkp/e5ada42c892e4a4e9937ccb4d36c78e7\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"2Q3rHUv6xS8gaQ3krL3GfbuDTjpZ4m2Xh16kAQ26p3sbANXU84Uxs7JPktqCA1Dj3LRFe7tlgjCZfTGm2ZXfNkCJXMgeL8Bu5SINPflPcoE-3VcL3yQBUXkeas7OqXHyhPaqJezvvDffLCUI07YJxYjpKYx8n6jkh-D739-82r9U0g3I1BUYOi3vsowXFyHEU_fMDE8bJ-1MHtbGbKRhG6DrFBELUmnGIqFQ2MQ3WKH14BUIMZyEBkMqH9zLEl4c1hBBN8v8RgwgJUHBOR8fvexYjpDb_NETUv6KlnLR_2H5qCpM5MUOIItbqN003QIBhTdx_RHmMZwxcm5aFb89Rw\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1470959479,\"updated\":1470959479}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'c13bfefc-e3ce-4d09-9d69-e86630ed24fa', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 22:59:57 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:21 GMT', connection: 'close', - 'content-length': '623' }); + 'content-length': '624' }); return result; }], [function (nock) { var result = -nock('http://nodesdktest.vault.azure.net:443') +nock('http://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) -.put('/keys/nodeKey/import?api-version=2015-06-01', '*') - .reply(200, {"key":{"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/291f63ad17034963ab23eeb3ba530485","kty":"RSA","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"2E2mRyr2K55w1RHwmMTGkW5Z4ZKBmf-BlL4It1yZZkYks4k0QkNHDjFqLMkQkXL8bEMJ5doAq7WUWKOG4JBlIwBpoYBjgtI97TCARH1yTA1s3TDc2ZYlSnCBohlw6r68OYOjHHWpY4J3HgeoNuLkIMTcM5el3zI0F11OBUgC0PyuZ9rlZc_4C0NGAg604vmiz6dOjY-o-KnGOfo1qyfMl1DDCeEur-Dy0UEFB6XeSd4SlNHlc3-ViN23flWTSgw710RYRaL8XHar6O7Ml4nqO7KKvSJcHnZgPzZDsoqxvNnbpwuCr_2pOrjy2ygJy2Gz_H4nhobDxzy1pXogEd8snQ","e":"AQAB"},"attributes":{"enabled":true,"created":1438729198,"updated":1438729198}}, { 'cache-control': 'no-cache', +.put('/keys/nodeKey?api-version=2015-06-01', '*') + .reply(200, "{\"key\":{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/c29c099d0b1f4ca68687d0e3e19ed589\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"2E2mRyr2K55w1RHwmMTGkW5Z4ZKBmf-BlL4It1yZZkYks4k0QkNHDjFqLMkQkXL8bEMJ5doAq7WUWKOG4JBlIwBpoYBjgtI97TCARH1yTA1s3TDc2ZYlSnCBohlw6r68OYOjHHWpY4J3HgeoNuLkIMTcM5el3zI0F11OBUgC0PyuZ9rlZc_4C0NGAg604vmiz6dOjY-o-KnGOfo1qyfMl1DDCeEur-Dy0UEFB6XeSd4SlNHlc3-ViN23flWTSgw710RYRaL8XHar6O7Ml4nqO7KKvSJcHnZgPzZDsoqxvNnbpwuCr_2pOrjy2ygJy2Gz_H4nhobDxzy1pXogEd8snQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1470959481,\"updated\":1470959481}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '7cdded99-13bf-4e7c-a68b-f03ec83ed707', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 22:59:58 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:22 GMT', connection: 'close', - 'content-length': '617' }); + 'content-length': '618' }); return result; }, function (nock) { var result = -nock('https://nodesdktest.vault.azure.net:443') +nock('https://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) -.put('/keys/nodeKey/import?api-version=2015-06-01', '*') - .reply(200, {"key":{"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/291f63ad17034963ab23eeb3ba530485","kty":"RSA","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"2E2mRyr2K55w1RHwmMTGkW5Z4ZKBmf-BlL4It1yZZkYks4k0QkNHDjFqLMkQkXL8bEMJ5doAq7WUWKOG4JBlIwBpoYBjgtI97TCARH1yTA1s3TDc2ZYlSnCBohlw6r68OYOjHHWpY4J3HgeoNuLkIMTcM5el3zI0F11OBUgC0PyuZ9rlZc_4C0NGAg604vmiz6dOjY-o-KnGOfo1qyfMl1DDCeEur-Dy0UEFB6XeSd4SlNHlc3-ViN23flWTSgw710RYRaL8XHar6O7Ml4nqO7KKvSJcHnZgPzZDsoqxvNnbpwuCr_2pOrjy2ygJy2Gz_H4nhobDxzy1pXogEd8snQ","e":"AQAB"},"attributes":{"enabled":true,"created":1438729198,"updated":1438729198}}, { 'cache-control': 'no-cache', +.put('/keys/nodeKey?api-version=2015-06-01', '*') + .reply(200, "{\"key\":{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/c29c099d0b1f4ca68687d0e3e19ed589\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"2E2mRyr2K55w1RHwmMTGkW5Z4ZKBmf-BlL4It1yZZkYks4k0QkNHDjFqLMkQkXL8bEMJ5doAq7WUWKOG4JBlIwBpoYBjgtI97TCARH1yTA1s3TDc2ZYlSnCBohlw6r68OYOjHHWpY4J3HgeoNuLkIMTcM5el3zI0F11OBUgC0PyuZ9rlZc_4C0NGAg604vmiz6dOjY-o-KnGOfo1qyfMl1DDCeEur-Dy0UEFB6XeSd4SlNHlc3-ViN23flWTSgw710RYRaL8XHar6O7Ml4nqO7KKvSJcHnZgPzZDsoqxvNnbpwuCr_2pOrjy2ygJy2Gz_H4nhobDxzy1pXogEd8snQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1470959481,\"updated\":1470959481}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '7cdded99-13bf-4e7c-a68b-f03ec83ed707', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 22:59:58 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:22 GMT', connection: 'close', - 'content-length': '617' }); + 'content-length': '618' }); return result; }, function (nock) { var result = -nock('http://nodesdktest.vault.azure.net:443') +nock('http://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) .post('/keys/nodeKey/encrypt?api-version=2015-06-01', '*') - .reply(200, {"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/291f63ad17034963ab23eeb3ba530485","value":"XocNjo0wHj_dOyWSHeDuyYmuEHLuesTbBUWOAXYeP1zi0HUtDQQYgJwkK5A5ms9oEUIYhMnvfEFOjpZdc6e65VlKkQH0-LEA-jh-dNHrp7eHlguL8Qq0uUJIAN24qPqrD3kroBRPgUT3v8Ia4_gGODiOE5pqOA-Lt_BM2NpNwUizJnXnRRVX2qoChMw4Y8qf41HGx4xia2LNfmzwym7Kj5pbUJ3uQkJrNbdaXOAXxVxBBsh8d9_Zq3fIS9HcO4JHo5ic4CKE7vRxFEXT5kSvggiJr5RFodQ6gCafMN3NXNjtvGN6IvrXrcr7DVjHrbbqjNxKJ7rwkLsFeK_QYLbqaw"}, { 'cache-control': 'no-cache', + .reply(200, "{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/c29c099d0b1f4ca68687d0e3e19ed589\",\"value\":\"vIw4Bf2YN_EbHhUisLElExHd2fJAWxpsTUwOeIY7NtpydNZHcAnon812sNvcot8Dl5jU8luVJd6RGsukx5NrVPQX_trAD44q-VHm9wd0gMFBFs6ie3QOypyy9s-WPhLAYuETHP0e4fK0XPQ9IDR3qoeEPMMi--qzmLPMo_kNYDrbGvdHFpaZXytouHOFdSEMVwuM8ZApIFAVCuM1DVdkszmKbIyhDJ2ws4_fkSZex_TNL9ZdvUMQxE8tCOPDZmbGbiiNVas0KiOZFEeqDIj_mPQSPENF9btcxwcMuUs03VA9NXS3v2D1mvXfEEKeGBK98I4hSUFw_ioSMb1q6dbf2g\"}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'a92cab97-bfe3-4689-9940-a5b1b02892ee', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 22:59:58 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:22 GMT', connection: 'close', - 'content-length': '448' }); + 'content-length': '449' }); return result; }, function (nock) { var result = -nock('https://nodesdktest.vault.azure.net:443') +nock('https://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) .post('/keys/nodeKey/encrypt?api-version=2015-06-01', '*') - .reply(200, {"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/291f63ad17034963ab23eeb3ba530485","value":"XocNjo0wHj_dOyWSHeDuyYmuEHLuesTbBUWOAXYeP1zi0HUtDQQYgJwkK5A5ms9oEUIYhMnvfEFOjpZdc6e65VlKkQH0-LEA-jh-dNHrp7eHlguL8Qq0uUJIAN24qPqrD3kroBRPgUT3v8Ia4_gGODiOE5pqOA-Lt_BM2NpNwUizJnXnRRVX2qoChMw4Y8qf41HGx4xia2LNfmzwym7Kj5pbUJ3uQkJrNbdaXOAXxVxBBsh8d9_Zq3fIS9HcO4JHo5ic4CKE7vRxFEXT5kSvggiJr5RFodQ6gCafMN3NXNjtvGN6IvrXrcr7DVjHrbbqjNxKJ7rwkLsFeK_QYLbqaw"}, { 'cache-control': 'no-cache', + .reply(200, "{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/c29c099d0b1f4ca68687d0e3e19ed589\",\"value\":\"vIw4Bf2YN_EbHhUisLElExHd2fJAWxpsTUwOeIY7NtpydNZHcAnon812sNvcot8Dl5jU8luVJd6RGsukx5NrVPQX_trAD44q-VHm9wd0gMFBFs6ie3QOypyy9s-WPhLAYuETHP0e4fK0XPQ9IDR3qoeEPMMi--qzmLPMo_kNYDrbGvdHFpaZXytouHOFdSEMVwuM8ZApIFAVCuM1DVdkszmKbIyhDJ2ws4_fkSZex_TNL9ZdvUMQxE8tCOPDZmbGbiiNVas0KiOZFEeqDIj_mPQSPENF9btcxwcMuUs03VA9NXS3v2D1mvXfEEKeGBK98I4hSUFw_ioSMb1q6dbf2g\"}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'a92cab97-bfe3-4689-9940-a5b1b02892ee', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 22:59:58 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:22 GMT', connection: 'close', - 'content-length': '448' }); + 'content-length': '449' }); return result; }, function (nock) { var result = -nock('http://nodesdktest.vault.azure.net:443') +nock('http://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) .post('/keys/nodeKey/decrypt?api-version=2015-06-01', '*') - .reply(200, {"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/291f63ad17034963ab23eeb3ba530485","value":"3Y5h5oesyasX3LF56H8TGOdRJSLtkyvmeR47rIuj2qt5uesz5bYId0RQjJJRXJ-8KkMDe3JRdZGi2oUJMzF2MXLGWYlKeFkkzDMX_NhXfufsUA6O8Q_uS_pUUHEqJ6c6YYQdbg"}, { 'cache-control': 'no-cache', + .reply(200, "{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/c29c099d0b1f4ca68687d0e3e19ed589\",\"value\":\"3Y5h5oesyasX3LF56H8TGOdRJSLtkyvmeR47rIuj2qt5uesz5bYId0RQjJJRXJ-8KkMDe3JRdZGi2oUJMzF2MXLGWYlKeFkkzDMX_NhXfufsUA6O8Q_uS_pUUHEqJ6c6YYQdbg\"}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '3a8b6185-d996-4341-96ab-a7dd67b8b4d8', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 23:00:00 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:21 GMT', connection: 'close', - 'content-length': '240' }); + 'content-length': '241' }); return result; }, function (nock) { var result = -nock('https://nodesdktest.vault.azure.net:443') +nock('https://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) .post('/keys/nodeKey/decrypt?api-version=2015-06-01', '*') - .reply(200, {"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/291f63ad17034963ab23eeb3ba530485","value":"3Y5h5oesyasX3LF56H8TGOdRJSLtkyvmeR47rIuj2qt5uesz5bYId0RQjJJRXJ-8KkMDe3JRdZGi2oUJMzF2MXLGWYlKeFkkzDMX_NhXfufsUA6O8Q_uS_pUUHEqJ6c6YYQdbg"}, { 'cache-control': 'no-cache', + .reply(200, "{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/c29c099d0b1f4ca68687d0e3e19ed589\",\"value\":\"3Y5h5oesyasX3LF56H8TGOdRJSLtkyvmeR47rIuj2qt5uesz5bYId0RQjJJRXJ-8KkMDe3JRdZGi2oUJMzF2MXLGWYlKeFkkzDMX_NhXfufsUA6O8Q_uS_pUUHEqJ6c6YYQdbg\"}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '3a8b6185-d996-4341-96ab-a7dd67b8b4d8', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 23:00:00 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:21 GMT', connection: 'close', - 'content-length': '240' }); + 'content-length': '241' }); return result; }, function (nock) { var result = -nock('http://nodesdktest.vault.azure.net:443') +nock('http://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) -.post('/keys/nodeKey/291f63ad17034963ab23eeb3ba530485/encrypt?api-version=2015-06-01', '*') - .reply(200, {"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/291f63ad17034963ab23eeb3ba530485","value":"RzrSI3G46VQ_GP5TkQqp7XhtV4FUPZo3Fa96d_DDSteXkBBFa53vFFONa8GRpvyTzPB59QtYQjHmp8wzn2vqnwZf4Yy6bD1mP-DScODarTw1f7Kr3OOlHMXlzxfmcXaZs-jqMMxUBVgSDGIVBWFdEqsy8bSaPMFfUlgMUsUjCgS26pGBfeYRAkIfBAcJaV2O6H0ahAmjoHVo5fmbtUju2EKgAZ6iq6AOdndPmWsHbTkvubv5Vx49spfO_AAPcCTQ2SdmVE2ciBN70jPXueBj02l-se94vVQWv68JFG1RMe-SduBThFPqDdcnS4pSRiIKtFIRMV59tqzP2YfcmrJSnw"}, { 'cache-control': 'no-cache', +.post('/keys/nodeKey/c29c099d0b1f4ca68687d0e3e19ed589/encrypt?api-version=2015-06-01', '*') + .reply(200, "{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/c29c099d0b1f4ca68687d0e3e19ed589\",\"value\":\"aI_2u-K6JTWqAbWiHjL61yYAQ5GReMb--2dmWnWBtgvdmzn9fl9nruaP9vY-kRaCeTsbxTOlqmIkgFgb-kNCs6WCwVQMJ5NsfLs4rUnyf-UV_IabPHeIRjOAJwL5WGviFARZq8ZzLeETf50A8KnErg-KzmAF7Foi7dTYkfgjd2XXsjJ4gO-6w3oXTWh0PGCnlNZL8mYrw_4G3x2Ak7R14ck_Sa29LDcDtzaK9mQYjkLmuf4a4oT7La4yHvl78joO5kkodyJGPX5LNOzKO6aLWpz1KddIzK3MoDHf1MWjPrzjmchexQTtVrkUiyhc0a6D5YqTyFR4e21u0VRRkoAwrA\"}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '420b2ee0-1a2a-4d72-b40c-d73300c66ee0', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 23:00:00 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:22 GMT', connection: 'close', - 'content-length': '448' }); + 'content-length': '449' }); return result; }, function (nock) { var result = -nock('https://nodesdktest.vault.azure.net:443') +nock('https://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) -.post('/keys/nodeKey/291f63ad17034963ab23eeb3ba530485/encrypt?api-version=2015-06-01', '*') - .reply(200, {"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/291f63ad17034963ab23eeb3ba530485","value":"RzrSI3G46VQ_GP5TkQqp7XhtV4FUPZo3Fa96d_DDSteXkBBFa53vFFONa8GRpvyTzPB59QtYQjHmp8wzn2vqnwZf4Yy6bD1mP-DScODarTw1f7Kr3OOlHMXlzxfmcXaZs-jqMMxUBVgSDGIVBWFdEqsy8bSaPMFfUlgMUsUjCgS26pGBfeYRAkIfBAcJaV2O6H0ahAmjoHVo5fmbtUju2EKgAZ6iq6AOdndPmWsHbTkvubv5Vx49spfO_AAPcCTQ2SdmVE2ciBN70jPXueBj02l-se94vVQWv68JFG1RMe-SduBThFPqDdcnS4pSRiIKtFIRMV59tqzP2YfcmrJSnw"}, { 'cache-control': 'no-cache', +.post('/keys/nodeKey/c29c099d0b1f4ca68687d0e3e19ed589/encrypt?api-version=2015-06-01', '*') + .reply(200, "{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/c29c099d0b1f4ca68687d0e3e19ed589\",\"value\":\"aI_2u-K6JTWqAbWiHjL61yYAQ5GReMb--2dmWnWBtgvdmzn9fl9nruaP9vY-kRaCeTsbxTOlqmIkgFgb-kNCs6WCwVQMJ5NsfLs4rUnyf-UV_IabPHeIRjOAJwL5WGviFARZq8ZzLeETf50A8KnErg-KzmAF7Foi7dTYkfgjd2XXsjJ4gO-6w3oXTWh0PGCnlNZL8mYrw_4G3x2Ak7R14ck_Sa29LDcDtzaK9mQYjkLmuf4a4oT7La4yHvl78joO5kkodyJGPX5LNOzKO6aLWpz1KddIzK3MoDHf1MWjPrzjmchexQTtVrkUiyhc0a6D5YqTyFR4e21u0VRRkoAwrA\"}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '420b2ee0-1a2a-4d72-b40c-d73300c66ee0', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 23:00:00 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:22 GMT', connection: 'close', - 'content-length': '448' }); + 'content-length': '449' }); return result; }, function (nock) { var result = -nock('http://nodesdktest.vault.azure.net:443') +nock('http://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) -.post('/keys/nodeKey/291f63ad17034963ab23eeb3ba530485/decrypt?api-version=2015-06-01', '*') - .reply(200, {"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/291f63ad17034963ab23eeb3ba530485","value":"3Y5h5oesyasX3LF56H8TGOdRJSLtkyvmeR47rIuj2qt5uesz5bYId0RQjJJRXJ-8KkMDe3JRdZGi2oUJMzF2MXLGWYlKeFkkzDMX_NhXfufsUA6O8Q_uS_pUUHEqJ6c6YYQdbg"}, { 'cache-control': 'no-cache', +.post('/keys/nodeKey/c29c099d0b1f4ca68687d0e3e19ed589/decrypt?api-version=2015-06-01', '*') + .reply(200, "{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/c29c099d0b1f4ca68687d0e3e19ed589\",\"value\":\"3Y5h5oesyasX3LF56H8TGOdRJSLtkyvmeR47rIuj2qt5uesz5bYId0RQjJJRXJ-8KkMDe3JRdZGi2oUJMzF2MXLGWYlKeFkkzDMX_NhXfufsUA6O8Q_uS_pUUHEqJ6c6YYQdbg\"}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '7c462cdb-f89a-4d9e-96a1-871f1e0e980f', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 23:00:00 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:23 GMT', connection: 'close', - 'content-length': '240' }); + 'content-length': '241' }); return result; }, function (nock) { var result = -nock('https://nodesdktest.vault.azure.net:443') +nock('https://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) -.post('/keys/nodeKey/291f63ad17034963ab23eeb3ba530485/decrypt?api-version=2015-06-01', '*') - .reply(200, {"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/291f63ad17034963ab23eeb3ba530485","value":"3Y5h5oesyasX3LF56H8TGOdRJSLtkyvmeR47rIuj2qt5uesz5bYId0RQjJJRXJ-8KkMDe3JRdZGi2oUJMzF2MXLGWYlKeFkkzDMX_NhXfufsUA6O8Q_uS_pUUHEqJ6c6YYQdbg"}, { 'cache-control': 'no-cache', +.post('/keys/nodeKey/c29c099d0b1f4ca68687d0e3e19ed589/decrypt?api-version=2015-06-01', '*') + .reply(200, "{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/c29c099d0b1f4ca68687d0e3e19ed589\",\"value\":\"3Y5h5oesyasX3LF56H8TGOdRJSLtkyvmeR47rIuj2qt5uesz5bYId0RQjJJRXJ-8KkMDe3JRdZGi2oUJMzF2MXLGWYlKeFkkzDMX_NhXfufsUA6O8Q_uS_pUUHEqJ6c6YYQdbg\"}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '7c462cdb-f89a-4d9e-96a1-871f1e0e980f', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 23:00:00 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:23 GMT', connection: 'close', - 'content-length': '240' }); + 'content-length': '241' }); return result; }], [function (nock) { var result = -nock('http://nodesdktest.vault.azure.net:443') +nock('http://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) -.put('/keys/nodeKey/import?api-version=2015-06-01', '*') - .reply(200, {"key":{"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/d3f3acf004ea4fff95d604923e46c0d7","kty":"RSA","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"2E2mRyr2K55w1RHwmMTGkW5Z4ZKBmf-BlL4It1yZZkYks4k0QkNHDjFqLMkQkXL8bEMJ5doAq7WUWKOG4JBlIwBpoYBjgtI97TCARH1yTA1s3TDc2ZYlSnCBohlw6r68OYOjHHWpY4J3HgeoNuLkIMTcM5el3zI0F11OBUgC0PyuZ9rlZc_4C0NGAg604vmiz6dOjY-o-KnGOfo1qyfMl1DDCeEur-Dy0UEFB6XeSd4SlNHlc3-ViN23flWTSgw710RYRaL8XHar6O7Ml4nqO7KKvSJcHnZgPzZDsoqxvNnbpwuCr_2pOrjy2ygJy2Gz_H4nhobDxzy1pXogEd8snQ","e":"AQAB"},"attributes":{"enabled":true,"created":1438729201,"updated":1438729201}}, { 'cache-control': 'no-cache', +.put('/keys/nodeKey?api-version=2015-06-01', '*') + .reply(200, "{\"key\":{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/55e903da78dd40e48f9d9081c34e1d0c\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"2E2mRyr2K55w1RHwmMTGkW5Z4ZKBmf-BlL4It1yZZkYks4k0QkNHDjFqLMkQkXL8bEMJ5doAq7WUWKOG4JBlIwBpoYBjgtI97TCARH1yTA1s3TDc2ZYlSnCBohlw6r68OYOjHHWpY4J3HgeoNuLkIMTcM5el3zI0F11OBUgC0PyuZ9rlZc_4C0NGAg604vmiz6dOjY-o-KnGOfo1qyfMl1DDCeEur-Dy0UEFB6XeSd4SlNHlc3-ViN23flWTSgw710RYRaL8XHar6O7Ml4nqO7KKvSJcHnZgPzZDsoqxvNnbpwuCr_2pOrjy2ygJy2Gz_H4nhobDxzy1pXogEd8snQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1470959483,\"updated\":1470959483}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'faac068b-97d4-406f-ba41-3f1c1086a346', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 23:00:01 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:23 GMT', connection: 'close', - 'content-length': '617' }); + 'content-length': '618' }); return result; }, function (nock) { var result = -nock('https://nodesdktest.vault.azure.net:443') +nock('https://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) -.put('/keys/nodeKey/import?api-version=2015-06-01', '*') - .reply(200, {"key":{"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/d3f3acf004ea4fff95d604923e46c0d7","kty":"RSA","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"2E2mRyr2K55w1RHwmMTGkW5Z4ZKBmf-BlL4It1yZZkYks4k0QkNHDjFqLMkQkXL8bEMJ5doAq7WUWKOG4JBlIwBpoYBjgtI97TCARH1yTA1s3TDc2ZYlSnCBohlw6r68OYOjHHWpY4J3HgeoNuLkIMTcM5el3zI0F11OBUgC0PyuZ9rlZc_4C0NGAg604vmiz6dOjY-o-KnGOfo1qyfMl1DDCeEur-Dy0UEFB6XeSd4SlNHlc3-ViN23flWTSgw710RYRaL8XHar6O7Ml4nqO7KKvSJcHnZgPzZDsoqxvNnbpwuCr_2pOrjy2ygJy2Gz_H4nhobDxzy1pXogEd8snQ","e":"AQAB"},"attributes":{"enabled":true,"created":1438729201,"updated":1438729201}}, { 'cache-control': 'no-cache', +.put('/keys/nodeKey?api-version=2015-06-01', '*') + .reply(200, "{\"key\":{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/55e903da78dd40e48f9d9081c34e1d0c\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"2E2mRyr2K55w1RHwmMTGkW5Z4ZKBmf-BlL4It1yZZkYks4k0QkNHDjFqLMkQkXL8bEMJ5doAq7WUWKOG4JBlIwBpoYBjgtI97TCARH1yTA1s3TDc2ZYlSnCBohlw6r68OYOjHHWpY4J3HgeoNuLkIMTcM5el3zI0F11OBUgC0PyuZ9rlZc_4C0NGAg604vmiz6dOjY-o-KnGOfo1qyfMl1DDCeEur-Dy0UEFB6XeSd4SlNHlc3-ViN23flWTSgw710RYRaL8XHar6O7Ml4nqO7KKvSJcHnZgPzZDsoqxvNnbpwuCr_2pOrjy2ygJy2Gz_H4nhobDxzy1pXogEd8snQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1470959483,\"updated\":1470959483}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'faac068b-97d4-406f-ba41-3f1c1086a346', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 23:00:01 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:23 GMT', connection: 'close', - 'content-length': '617' }); + 'content-length': '618' }); return result; }, function (nock) { var result = -nock('http://nodesdktest.vault.azure.net:443') +nock('http://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) .post('/keys/nodeKey/wrapkey?api-version=2015-06-01', '*') - .reply(200, {"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/d3f3acf004ea4fff95d604923e46c0d7","value":"C9jZSIaQr0JxLR9GJ-U2-1qT0THPACrBHtYZrh-tD25tlTLbO-bsQPIzZOxvaXKVPX5InEDlYf7sTBWR9RE4zZdYv2jlDU5UqhEGPPo_RFqEqZajKfvPur3rzeYqfFqMKUeuQXTfBHYtSappfu9bT734I8nhWGILuT5h0gJv8nbOZuqAYmyIxlHXQToyhnieK31hH9sGRtD29mLvuhawCaOfLgORs5I8X2lL9D6-NG-KVV6UwzOjuYHz2lQatQxFBZ5eetnzSM2ksJtRXa0SxjWO6p0AUYZWee21QNOOWvGoLYVkCHcFr6ojMFycoipW5nU8kjYmvfeOwStskoh7Zg"}, { 'cache-control': 'no-cache', + .reply(200, "{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/55e903da78dd40e48f9d9081c34e1d0c\",\"value\":\"KNs8ieu79zhvbcZd5wz3XW9HSS6q3NL5UBcAvVGlSTFoHwE697uQnREn0zwCQ8bs0OyQc95zDfAVVqHwfZW_NZyYs1imYkRK_hix6ZBP6b-MrUJiKsIYp323EAxlJ8k70elsVK6rawIE13FI7zCzHyQno_U9CVoAVlTvsuxW21vcq24TBQAbmVQK6Ly35wMURWt9nsgRi2Ec3LvpIJlut-16_BfFP_QGzhfW86Kg8_x7hG5R4vYOVlZFunh46QgEdTP8FfsVfzrZ96PfL44t4cGMvnq5RWTi2MPl7VEHpCaXPTmh9FxVL5xVBhfVUe3yRs02shOACn2v0XlFRCWN2g\"}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '3b018b42-f039-4eb3-a55f-78ed49d5e53c', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 23:00:02 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:23 GMT', connection: 'close', - 'content-length': '448' }); + 'content-length': '449' }); return result; }, function (nock) { var result = -nock('https://nodesdktest.vault.azure.net:443') +nock('https://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) .post('/keys/nodeKey/wrapkey?api-version=2015-06-01', '*') - .reply(200, {"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/d3f3acf004ea4fff95d604923e46c0d7","value":"C9jZSIaQr0JxLR9GJ-U2-1qT0THPACrBHtYZrh-tD25tlTLbO-bsQPIzZOxvaXKVPX5InEDlYf7sTBWR9RE4zZdYv2jlDU5UqhEGPPo_RFqEqZajKfvPur3rzeYqfFqMKUeuQXTfBHYtSappfu9bT734I8nhWGILuT5h0gJv8nbOZuqAYmyIxlHXQToyhnieK31hH9sGRtD29mLvuhawCaOfLgORs5I8X2lL9D6-NG-KVV6UwzOjuYHz2lQatQxFBZ5eetnzSM2ksJtRXa0SxjWO6p0AUYZWee21QNOOWvGoLYVkCHcFr6ojMFycoipW5nU8kjYmvfeOwStskoh7Zg"}, { 'cache-control': 'no-cache', + .reply(200, "{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/55e903da78dd40e48f9d9081c34e1d0c\",\"value\":\"KNs8ieu79zhvbcZd5wz3XW9HSS6q3NL5UBcAvVGlSTFoHwE697uQnREn0zwCQ8bs0OyQc95zDfAVVqHwfZW_NZyYs1imYkRK_hix6ZBP6b-MrUJiKsIYp323EAxlJ8k70elsVK6rawIE13FI7zCzHyQno_U9CVoAVlTvsuxW21vcq24TBQAbmVQK6Ly35wMURWt9nsgRi2Ec3LvpIJlut-16_BfFP_QGzhfW86Kg8_x7hG5R4vYOVlZFunh46QgEdTP8FfsVfzrZ96PfL44t4cGMvnq5RWTi2MPl7VEHpCaXPTmh9FxVL5xVBhfVUe3yRs02shOACn2v0XlFRCWN2g\"}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '3b018b42-f039-4eb3-a55f-78ed49d5e53c', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 23:00:02 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:23 GMT', connection: 'close', - 'content-length': '448' }); + 'content-length': '449' }); return result; }, function (nock) { var result = -nock('http://nodesdktest.vault.azure.net:443') +nock('http://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) .post('/keys/nodeKey/unwrapkey?api-version=2015-06-01', '*') - .reply(200, {"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/d3f3acf004ea4fff95d604923e46c0d7","value":"Wa8DE-d3U27TUVkT2RXWrRUOcOyjDGJ6XhACZf7e3JFeOmSn0eYDEwju3lFDItDiuu4CeQ4_m38KvvXrT2B92I-xChdT8PSEnjUegJwVy8iEaP_ref3C8AmcpTX1IqcxPZNuIw"}, { 'cache-control': 'no-cache', + .reply(200, "{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/55e903da78dd40e48f9d9081c34e1d0c\",\"value\":\"Wa8DE-d3U27TUVkT2RXWrRUOcOyjDGJ6XhACZf7e3JFeOmSn0eYDEwju3lFDItDiuu4CeQ4_m38KvvXrT2B92I-xChdT8PSEnjUegJwVy8iEaP_ref3C8AmcpTX1IqcxPZNuIw\"}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '34ab5872-4c86-496f-8323-1dcbb63dc982', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 23:00:02 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:23 GMT', connection: 'close', - 'content-length': '240' }); + 'content-length': '241' }); return result; }, function (nock) { var result = -nock('https://nodesdktest.vault.azure.net:443') +nock('https://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) .post('/keys/nodeKey/unwrapkey?api-version=2015-06-01', '*') - .reply(200, {"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/d3f3acf004ea4fff95d604923e46c0d7","value":"Wa8DE-d3U27TUVkT2RXWrRUOcOyjDGJ6XhACZf7e3JFeOmSn0eYDEwju3lFDItDiuu4CeQ4_m38KvvXrT2B92I-xChdT8PSEnjUegJwVy8iEaP_ref3C8AmcpTX1IqcxPZNuIw"}, { 'cache-control': 'no-cache', + .reply(200, "{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/55e903da78dd40e48f9d9081c34e1d0c\",\"value\":\"Wa8DE-d3U27TUVkT2RXWrRUOcOyjDGJ6XhACZf7e3JFeOmSn0eYDEwju3lFDItDiuu4CeQ4_m38KvvXrT2B92I-xChdT8PSEnjUegJwVy8iEaP_ref3C8AmcpTX1IqcxPZNuIw\"}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '34ab5872-4c86-496f-8323-1dcbb63dc982', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 23:00:02 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:23 GMT', connection: 'close', - 'content-length': '240' }); + 'content-length': '241' }); return result; }, function (nock) { var result = -nock('http://nodesdktest.vault.azure.net:443') +nock('http://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) -.post('/keys/nodeKey/d3f3acf004ea4fff95d604923e46c0d7/wrapkey?api-version=2015-06-01', '*') - .reply(200, {"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/d3f3acf004ea4fff95d604923e46c0d7","value":"WVEJCY4IcvYR-6G1wkh9_8JYwf4xnWcrpVhFBnuOI8JZoAbp0xTv_S0hlVvQea3X63c3xpBrWSA-zLRUCdwMPz-rmULgVOFdNBewnIa5zMVVNKfZRyU2uAri5q2bMTiEhN6P5sM4JEsoPWnuxoh5JXyuhA3hW9B6QQ6lD-uOg3ogviMbj5ztJ_EOCM_RAGe3608xsSB-eyhGbZXFqoGgBXSE6HvvftPEGNsQggGJPn523DXAEmmmVpUFKwIpcSKwx7Y32UwIFG4t3Cxm6iSp748ePTYK7dV7gdeeP8oBRiTEucAVNOkofY1HWoLqfxixrpwKQSZgRDweV0PjCv2CRQ"}, { 'cache-control': 'no-cache', +.post('/keys/nodeKey/55e903da78dd40e48f9d9081c34e1d0c/wrapkey?api-version=2015-06-01', '*') + .reply(200, "{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/55e903da78dd40e48f9d9081c34e1d0c\",\"value\":\"oXWFk82N4INDIEYwWvoKeZ2APMbmV_gKF1LbB8alTJcqcV1EPET6doWMd0pvuxadyE6eS12CBoqULEmOmjZ_ys7A3dGIrz9Um8ddObsOshWW-dPQC6NFDk2iyhxEXj4S2acm4NIAyoR5Xov9OnEFEvNQmIn33oITPqj9HWa_Pwpx9sJcJmgZbKk-MhrvwNx73MXcr_N_b0OPKNhVarlx19MIcIjutaymPjbV5L_rMDuJ05owsjbVWxpeRF5SWNGaPN9jeyAfcH7gitMNviZKNj1lJy14tiemK6JOIRd8ed89qCLutTiWNSn3B03UT3SPpi57jaymm1GuFb0kywZWvw\"}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'ef4ffe7f-1d4c-45c6-a896-b43d4f5b8331', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 23:00:03 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:24 GMT', connection: 'close', - 'content-length': '448' }); + 'content-length': '449' }); return result; }, function (nock) { var result = -nock('https://nodesdktest.vault.azure.net:443') +nock('https://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) -.post('/keys/nodeKey/d3f3acf004ea4fff95d604923e46c0d7/wrapkey?api-version=2015-06-01', '*') - .reply(200, {"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/d3f3acf004ea4fff95d604923e46c0d7","value":"WVEJCY4IcvYR-6G1wkh9_8JYwf4xnWcrpVhFBnuOI8JZoAbp0xTv_S0hlVvQea3X63c3xpBrWSA-zLRUCdwMPz-rmULgVOFdNBewnIa5zMVVNKfZRyU2uAri5q2bMTiEhN6P5sM4JEsoPWnuxoh5JXyuhA3hW9B6QQ6lD-uOg3ogviMbj5ztJ_EOCM_RAGe3608xsSB-eyhGbZXFqoGgBXSE6HvvftPEGNsQggGJPn523DXAEmmmVpUFKwIpcSKwx7Y32UwIFG4t3Cxm6iSp748ePTYK7dV7gdeeP8oBRiTEucAVNOkofY1HWoLqfxixrpwKQSZgRDweV0PjCv2CRQ"}, { 'cache-control': 'no-cache', +.post('/keys/nodeKey/55e903da78dd40e48f9d9081c34e1d0c/wrapkey?api-version=2015-06-01', '*') + .reply(200, "{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/55e903da78dd40e48f9d9081c34e1d0c\",\"value\":\"oXWFk82N4INDIEYwWvoKeZ2APMbmV_gKF1LbB8alTJcqcV1EPET6doWMd0pvuxadyE6eS12CBoqULEmOmjZ_ys7A3dGIrz9Um8ddObsOshWW-dPQC6NFDk2iyhxEXj4S2acm4NIAyoR5Xov9OnEFEvNQmIn33oITPqj9HWa_Pwpx9sJcJmgZbKk-MhrvwNx73MXcr_N_b0OPKNhVarlx19MIcIjutaymPjbV5L_rMDuJ05owsjbVWxpeRF5SWNGaPN9jeyAfcH7gitMNviZKNj1lJy14tiemK6JOIRd8ed89qCLutTiWNSn3B03UT3SPpi57jaymm1GuFb0kywZWvw\"}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'ef4ffe7f-1d4c-45c6-a896-b43d4f5b8331', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 23:00:03 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:24 GMT', connection: 'close', - 'content-length': '448' }); + 'content-length': '449' }); return result; }, function (nock) { var result = -nock('http://nodesdktest.vault.azure.net:443') +nock('http://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) -.post('/keys/nodeKey/d3f3acf004ea4fff95d604923e46c0d7/unwrapkey?api-version=2015-06-01', '*') - .reply(200, {"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/d3f3acf004ea4fff95d604923e46c0d7","value":"Wa8DE-d3U27TUVkT2RXWrRUOcOyjDGJ6XhACZf7e3JFeOmSn0eYDEwju3lFDItDiuu4CeQ4_m38KvvXrT2B92I-xChdT8PSEnjUegJwVy8iEaP_ref3C8AmcpTX1IqcxPZNuIw"}, { 'cache-control': 'no-cache', +.post('/keys/nodeKey/55e903da78dd40e48f9d9081c34e1d0c/unwrapkey?api-version=2015-06-01', '*') + .reply(200, "{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/55e903da78dd40e48f9d9081c34e1d0c\",\"value\":\"Wa8DE-d3U27TUVkT2RXWrRUOcOyjDGJ6XhACZf7e3JFeOmSn0eYDEwju3lFDItDiuu4CeQ4_m38KvvXrT2B92I-xChdT8PSEnjUegJwVy8iEaP_ref3C8AmcpTX1IqcxPZNuIw\"}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '40887af1-4a5c-455b-8d0a-278c932ea10b', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 23:00:02 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:25 GMT', connection: 'close', - 'content-length': '240' }); + 'content-length': '241' }); return result; }, function (nock) { var result = -nock('https://nodesdktest.vault.azure.net:443') +nock('https://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) -.post('/keys/nodeKey/d3f3acf004ea4fff95d604923e46c0d7/unwrapkey?api-version=2015-06-01', '*') - .reply(200, {"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/d3f3acf004ea4fff95d604923e46c0d7","value":"Wa8DE-d3U27TUVkT2RXWrRUOcOyjDGJ6XhACZf7e3JFeOmSn0eYDEwju3lFDItDiuu4CeQ4_m38KvvXrT2B92I-xChdT8PSEnjUegJwVy8iEaP_ref3C8AmcpTX1IqcxPZNuIw"}, { 'cache-control': 'no-cache', +.post('/keys/nodeKey/55e903da78dd40e48f9d9081c34e1d0c/unwrapkey?api-version=2015-06-01', '*') + .reply(200, "{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/55e903da78dd40e48f9d9081c34e1d0c\",\"value\":\"Wa8DE-d3U27TUVkT2RXWrRUOcOyjDGJ6XhACZf7e3JFeOmSn0eYDEwju3lFDItDiuu4CeQ4_m38KvvXrT2B92I-xChdT8PSEnjUegJwVy8iEaP_ref3C8AmcpTX1IqcxPZNuIw\"}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '40887af1-4a5c-455b-8d0a-278c932ea10b', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 23:00:02 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:25 GMT', connection: 'close', - 'content-length': '240' }); + 'content-length': '241' }); return result; }], [function (nock) { var result = -nock('http://nodesdktest.vault.azure.net:443') +nock('http://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) -.put('/keys/nodeKey/import?api-version=2015-06-01', '*') - .reply(200, {"key":{"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/84723c65c99d462ebd82a40535da632f","kty":"RSA","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"2E2mRyr2K55w1RHwmMTGkW5Z4ZKBmf-BlL4It1yZZkYks4k0QkNHDjFqLMkQkXL8bEMJ5doAq7WUWKOG4JBlIwBpoYBjgtI97TCARH1yTA1s3TDc2ZYlSnCBohlw6r68OYOjHHWpY4J3HgeoNuLkIMTcM5el3zI0F11OBUgC0PyuZ9rlZc_4C0NGAg604vmiz6dOjY-o-KnGOfo1qyfMl1DDCeEur-Dy0UEFB6XeSd4SlNHlc3-ViN23flWTSgw710RYRaL8XHar6O7Ml4nqO7KKvSJcHnZgPzZDsoqxvNnbpwuCr_2pOrjy2ygJy2Gz_H4nhobDxzy1pXogEd8snQ","e":"AQAB"},"attributes":{"enabled":true,"created":1438729203,"updated":1438729203}}, { 'cache-control': 'no-cache', +.put('/keys/nodeKey?api-version=2015-06-01', '*') + .reply(200, "{\"key\":{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/b5ee29c334ae465ba340dd4a757bc71c\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"2E2mRyr2K55w1RHwmMTGkW5Z4ZKBmf-BlL4It1yZZkYks4k0QkNHDjFqLMkQkXL8bEMJ5doAq7WUWKOG4JBlIwBpoYBjgtI97TCARH1yTA1s3TDc2ZYlSnCBohlw6r68OYOjHHWpY4J3HgeoNuLkIMTcM5el3zI0F11OBUgC0PyuZ9rlZc_4C0NGAg604vmiz6dOjY-o-KnGOfo1qyfMl1DDCeEur-Dy0UEFB6XeSd4SlNHlc3-ViN23flWTSgw710RYRaL8XHar6O7Ml4nqO7KKvSJcHnZgPzZDsoqxvNnbpwuCr_2pOrjy2ygJy2Gz_H4nhobDxzy1pXogEd8snQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1470959485,\"updated\":1470959485}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '5f88e9e4-e41e-434b-9aa5-05ecf6b563ce', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 23:00:03 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:25 GMT', connection: 'close', - 'content-length': '617' }); + 'content-length': '618' }); return result; }, function (nock) { var result = -nock('https://nodesdktest.vault.azure.net:443') +nock('https://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) -.put('/keys/nodeKey/import?api-version=2015-06-01', '*') - .reply(200, {"key":{"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/84723c65c99d462ebd82a40535da632f","kty":"RSA","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"2E2mRyr2K55w1RHwmMTGkW5Z4ZKBmf-BlL4It1yZZkYks4k0QkNHDjFqLMkQkXL8bEMJ5doAq7WUWKOG4JBlIwBpoYBjgtI97TCARH1yTA1s3TDc2ZYlSnCBohlw6r68OYOjHHWpY4J3HgeoNuLkIMTcM5el3zI0F11OBUgC0PyuZ9rlZc_4C0NGAg604vmiz6dOjY-o-KnGOfo1qyfMl1DDCeEur-Dy0UEFB6XeSd4SlNHlc3-ViN23flWTSgw710RYRaL8XHar6O7Ml4nqO7KKvSJcHnZgPzZDsoqxvNnbpwuCr_2pOrjy2ygJy2Gz_H4nhobDxzy1pXogEd8snQ","e":"AQAB"},"attributes":{"enabled":true,"created":1438729203,"updated":1438729203}}, { 'cache-control': 'no-cache', +.put('/keys/nodeKey?api-version=2015-06-01', '*') + .reply(200, "{\"key\":{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/b5ee29c334ae465ba340dd4a757bc71c\",\"kty\":\"RSA\",\"key_ops\":[\"encrypt\",\"decrypt\",\"sign\",\"verify\",\"wrapKey\",\"unwrapKey\"],\"n\":\"2E2mRyr2K55w1RHwmMTGkW5Z4ZKBmf-BlL4It1yZZkYks4k0QkNHDjFqLMkQkXL8bEMJ5doAq7WUWKOG4JBlIwBpoYBjgtI97TCARH1yTA1s3TDc2ZYlSnCBohlw6r68OYOjHHWpY4J3HgeoNuLkIMTcM5el3zI0F11OBUgC0PyuZ9rlZc_4C0NGAg604vmiz6dOjY-o-KnGOfo1qyfMl1DDCeEur-Dy0UEFB6XeSd4SlNHlc3-ViN23flWTSgw710RYRaL8XHar6O7Ml4nqO7KKvSJcHnZgPzZDsoqxvNnbpwuCr_2pOrjy2ygJy2Gz_H4nhobDxzy1pXogEd8snQ\",\"e\":\"AQAB\"},\"attributes\":{\"enabled\":true,\"created\":1470959485,\"updated\":1470959485}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '5f88e9e4-e41e-434b-9aa5-05ecf6b563ce', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 23:00:03 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:25 GMT', connection: 'close', - 'content-length': '617' }); + 'content-length': '618' }); return result; }, function (nock) { var result = -nock('http://nodesdktest.vault.azure.net:443') +nock('http://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) .post('/keys/nodeKey/sign?api-version=2015-06-01', '*') - .reply(200, {"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/84723c65c99d462ebd82a40535da632f","value":"TdSqFCmuzVvgj94A9Yry1IdSsZJUcrfUJoCAiIZEkkLp2jh2MyqX3GArU99YhHcnEEtjxCi8VsJfjoXE1CJg6_4hiFx0Ja3if_VENF25MtQy28UEkHj-Ydb7_ZgNBMaCLSqs507E9sn2xj4Jfzp_tEhuh7DaG9T3YsfxtoWbD-MkyaUn3IpSq4r6e2t3km-gDGUSU2CaURfJNMjNuRNW2y9-nPcNIDTD4ysKEWcEdNXhxKdsa4aOAvi5oaMGqrbmu2OUbKFC063juyDPQ0IZtvs3a-93yfBShGhS6Vrg8Xdyl-ccu0cCZ3jWjEuKTAl50FiBdJyeEvCV3nF-q0GDmQ"}, { 'cache-control': 'no-cache', + .reply(200, "{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/b5ee29c334ae465ba340dd4a757bc71c\",\"value\":\"TdSqFCmuzVvgj94A9Yry1IdSsZJUcrfUJoCAiIZEkkLp2jh2MyqX3GArU99YhHcnEEtjxCi8VsJfjoXE1CJg6_4hiFx0Ja3if_VENF25MtQy28UEkHj-Ydb7_ZgNBMaCLSqs507E9sn2xj4Jfzp_tEhuh7DaG9T3YsfxtoWbD-MkyaUn3IpSq4r6e2t3km-gDGUSU2CaURfJNMjNuRNW2y9-nPcNIDTD4ysKEWcEdNXhxKdsa4aOAvi5oaMGqrbmu2OUbKFC063juyDPQ0IZtvs3a-93yfBShGhS6Vrg8Xdyl-ccu0cCZ3jWjEuKTAl50FiBdJyeEvCV3nF-q0GDmQ\"}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '211d720d-2d5b-4988-b69f-44950c7b97d0', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 23:00:04 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:26 GMT', connection: 'close', - 'content-length': '448' }); + 'content-length': '449' }); return result; }, function (nock) { var result = -nock('https://nodesdktest.vault.azure.net:443') +nock('https://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) .post('/keys/nodeKey/sign?api-version=2015-06-01', '*') - .reply(200, {"kid":"https://nodesdktest.vault.azure.net/keys/nodeKey/84723c65c99d462ebd82a40535da632f","value":"TdSqFCmuzVvgj94A9Yry1IdSsZJUcrfUJoCAiIZEkkLp2jh2MyqX3GArU99YhHcnEEtjxCi8VsJfjoXE1CJg6_4hiFx0Ja3if_VENF25MtQy28UEkHj-Ydb7_ZgNBMaCLSqs507E9sn2xj4Jfzp_tEhuh7DaG9T3YsfxtoWbD-MkyaUn3IpSq4r6e2t3km-gDGUSU2CaURfJNMjNuRNW2y9-nPcNIDTD4ysKEWcEdNXhxKdsa4aOAvi5oaMGqrbmu2OUbKFC063juyDPQ0IZtvs3a-93yfBShGhS6Vrg8Xdyl-ccu0cCZ3jWjEuKTAl50FiBdJyeEvCV3nF-q0GDmQ"}, { 'cache-control': 'no-cache', + .reply(200, "{\"kid\":\"https://sdktestvault0511.vault.azure.net/keys/nodeKey/b5ee29c334ae465ba340dd4a757bc71c\",\"value\":\"TdSqFCmuzVvgj94A9Yry1IdSsZJUcrfUJoCAiIZEkkLp2jh2MyqX3GArU99YhHcnEEtjxCi8VsJfjoXE1CJg6_4hiFx0Ja3if_VENF25MtQy28UEkHj-Ydb7_ZgNBMaCLSqs507E9sn2xj4Jfzp_tEhuh7DaG9T3YsfxtoWbD-MkyaUn3IpSq4r6e2t3km-gDGUSU2CaURfJNMjNuRNW2y9-nPcNIDTD4ysKEWcEdNXhxKdsa4aOAvi5oaMGqrbmu2OUbKFC063juyDPQ0IZtvs3a-93yfBShGhS6Vrg8Xdyl-ccu0cCZ3jWjEuKTAl50FiBdJyeEvCV3nF-q0GDmQ\"}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '211d720d-2d5b-4988-b69f-44950c7b97d0', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 23:00:04 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:26 GMT', connection: 'close', - 'content-length': '448' }); + 'content-length': '449' }); return result; }, function (nock) { var result = -nock('http://nodesdktest.vault.azure.net:443') +nock('http://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) .post('/keys/nodeKey/verify?api-version=2015-06-01', '*') - .reply(200, {"value":true}, { 'cache-control': 'no-cache', + .reply(200, "{\"value\":true}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '90e3481e-4a12-487e-b344-e70a4772c53e', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 23:00:03 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:26 GMT', connection: 'close', 'content-length': '14' }); return result; }, function (nock) { var result = -nock('https://nodesdktest.vault.azure.net:443') +nock('https://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) .post('/keys/nodeKey/verify?api-version=2015-06-01', '*') - .reply(200, {"value":true}, { 'cache-control': 'no-cache', + .reply(200, "{\"value\":true}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.103', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '90e3481e-4a12-487e-b344-e70a4772c53e', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Tue, 04 Aug 2015 23:00:03 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:26 GMT', connection: 'close', 'content-length': '14' }); return result; }]]; \ No newline at end of file diff --git a/test/recordings/keyVault-secret-tests.nock.js b/test/recordings/keyVault-secret-tests.nock.js index f767c30e4..9f99da226 100644 --- a/test/recordings/keyVault-secret-tests.nock.js +++ b/test/recordings/keyVault-secret-tests.nock.js @@ -3,281 +3,855 @@ exports.scopes = [[], [function (nock) { var result = -nock('http://nodesdktest.vault.azure.net:443') +nock('http://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) .put('/secrets/nodeSecret?api-version=2015-06-01', '*') - .reply(401, "", { 'cache-control': 'no-cache', + .reply(200, "{\"value\":\"Pa$$w0rd\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeSecret/7a63db27897e44e88c9ff02d709002a8\",\"attributes\":{\"enabled\":true,\"created\":1470959487,\"updated\":1470959487}}", { 'cache-control': 'no-cache', pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'www-authenticate': 'Bearer authorization="https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47", resource="https://vault.azure.net"', - 'x-ms-keyvault-service-version': '1.0.0.96', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '8c2119bf-c447-499f-bf5c-54028804ee18', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Thu, 18 Jun 2015 22:26:45 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:27 GMT', connection: 'close', - 'content-length': '0' }); + 'content-length': '192' }); return result; }, function (nock) { var result = -nock('https://nodesdktest.vault.azure.net:443') +nock('https://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) .put('/secrets/nodeSecret?api-version=2015-06-01', '*') - .reply(401, "", { 'cache-control': 'no-cache', + .reply(200, "{\"value\":\"Pa$$w0rd\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeSecret/7a63db27897e44e88c9ff02d709002a8\",\"attributes\":{\"enabled\":true,\"created\":1470959487,\"updated\":1470959487}}", { 'cache-control': 'no-cache', pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'www-authenticate': 'Bearer authorization="https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47", resource="https://vault.azure.net"', - 'x-ms-keyvault-service-version': '1.0.0.96', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '8c2119bf-c447-499f-bf5c-54028804ee18', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Thu, 18 Jun 2015 22:26:45 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:27 GMT', connection: 'close', - 'content-length': '0' }); + 'content-length': '192' }); return result; }, function (nock) { var result = -nock('http://nodesdktest.vault.azure.net:443') +nock('http://sdktestvault0511.vault.azure.net') + .get('/secrets/nodeSecret/?api-version=2015-06-01') + .reply(200, "{\"value\":\"Pa$$w0rd\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeSecret/7a63db27897e44e88c9ff02d709002a8\",\"attributes\":{\"enabled\":true,\"created\":1470959487,\"updated\":1470959487}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '27f671eb-3750-4e1d-82f6-4cdf77a19223', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:27 GMT', + connection: 'close', + 'content-length': '192' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/secrets/nodeSecret/?api-version=2015-06-01') + .reply(200, "{\"value\":\"Pa$$w0rd\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeSecret/7a63db27897e44e88c9ff02d709002a8\",\"attributes\":{\"enabled\":true,\"created\":1470959487,\"updated\":1470959487}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '27f671eb-3750-4e1d-82f6-4cdf77a19223', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:27 GMT', + connection: 'close', + 'content-length': '192' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/secrets/nodeSecret/7a63db27897e44e88c9ff02d709002a8?api-version=2015-06-01') + .reply(200, "{\"value\":\"Pa$$w0rd\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeSecret/7a63db27897e44e88c9ff02d709002a8\",\"attributes\":{\"enabled\":true,\"created\":1470959487,\"updated\":1470959487}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'c811881b-effa-4b2d-91b5-e8299241b5ac', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:27 GMT', + connection: 'close', + 'content-length': '192' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/secrets/nodeSecret/7a63db27897e44e88c9ff02d709002a8?api-version=2015-06-01') + .reply(200, "{\"value\":\"Pa$$w0rd\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeSecret/7a63db27897e44e88c9ff02d709002a8\",\"attributes\":{\"enabled\":true,\"created\":1470959487,\"updated\":1470959487}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'c811881b-effa-4b2d-91b5-e8299241b5ac', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:27 GMT', + connection: 'close', + 'content-length': '192' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) -.put('/secrets/nodeSecret?api-version=2015-06-01', '*') - .reply(200, {"value":"Pa$$w0rd","id":"https://nodesdktest.vault.azure.net/secrets/nodeSecret/bd7375f88ac54de8aedfabfe1c5baf53","attributes":{"enabled":true,"created":1434666405,"updated":1434666405}}, { 'cache-control': 'no-cache', +.patch('/secrets/nodeSecret/?api-version=2015-06-01', '*') + .reply(200, "{\"contentType\":\"text/plain\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeSecret/7a63db27897e44e88c9ff02d709002a8\",\"attributes\":{\"enabled\":true,\"exp\":2527401600,\"created\":1470959487,\"updated\":1470959488},\"tags\":{\"foo\":\"ede2c2613ab96101ef90e0f93ed400417324724f8d0793cc46156eb21c83a50b2aa6d24fbbdce46d3a06ef47b671ba579248\"}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.96', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'fedc1412-bbe9-4b79-92ec-d9c3fc865076', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Thu, 18 Jun 2015 22:26:45 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:27 GMT', connection: 'close', - 'content-length': '185' }); + 'content-length': '335' }); return result; }, function (nock) { var result = -nock('https://nodesdktest.vault.azure.net:443') +nock('https://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) -.put('/secrets/nodeSecret?api-version=2015-06-01', '*') - .reply(200, {"value":"Pa$$w0rd","id":"https://nodesdktest.vault.azure.net/secrets/nodeSecret/bd7375f88ac54de8aedfabfe1c5baf53","attributes":{"enabled":true,"created":1434666405,"updated":1434666405}}, { 'cache-control': 'no-cache', +.patch('/secrets/nodeSecret/?api-version=2015-06-01', '*') + .reply(200, "{\"contentType\":\"text/plain\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeSecret/7a63db27897e44e88c9ff02d709002a8\",\"attributes\":{\"enabled\":true,\"exp\":2527401600,\"created\":1470959487,\"updated\":1470959488},\"tags\":{\"foo\":\"ede2c2613ab96101ef90e0f93ed400417324724f8d0793cc46156eb21c83a50b2aa6d24fbbdce46d3a06ef47b671ba579248\"}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.96', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'fedc1412-bbe9-4b79-92ec-d9c3fc865076', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Thu, 18 Jun 2015 22:26:45 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:27 GMT', connection: 'close', - 'content-length': '185' }); + 'content-length': '335' }); return result; }, function (nock) { var result = -nock('http://nodesdktest.vault.azure.net:443') - .get('/secrets/nodeSecret?api-version=2015-06-01') - .reply(200, {"value":"Pa$$w0rd","id":"https://nodesdktest.vault.azure.net/secrets/nodeSecret/bd7375f88ac54de8aedfabfe1c5baf53","attributes":{"enabled":true,"created":1434666405,"updated":1434666405}}, { 'cache-control': 'no-cache', - pragma: 'no-cache', - 'content-type': 'application/json; charset=utf-8', - expires: '-1', - server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.96', - 'x-aspnet-version': '4.0.30319', - 'x-powered-by': 'ASP.NET', - 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Thu, 18 Jun 2015 22:26:45 GMT', - connection: 'close', - 'content-length': '185' }); - return result; }, -function (nock) { -var result = -nock('https://nodesdktest.vault.azure.net:443') - .get('/secrets/nodeSecret?api-version=2015-06-01') - .reply(200, {"value":"Pa$$w0rd","id":"https://nodesdktest.vault.azure.net/secrets/nodeSecret/bd7375f88ac54de8aedfabfe1c5baf53","attributes":{"enabled":true,"created":1434666405,"updated":1434666405}}, { 'cache-control': 'no-cache', - pragma: 'no-cache', - 'content-type': 'application/json; charset=utf-8', - expires: '-1', - server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.96', - 'x-aspnet-version': '4.0.30319', - 'x-powered-by': 'ASP.NET', - 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Thu, 18 Jun 2015 22:26:45 GMT', - connection: 'close', - 'content-length': '185' }); - return result; }, -function (nock) { -var result = -nock('http://nodesdktest.vault.azure.net:443') - .get('/secrets/nodeSecret/bd7375f88ac54de8aedfabfe1c5baf53?api-version=2015-06-01') - .reply(200, {"value":"Pa$$w0rd","id":"https://nodesdktest.vault.azure.net/secrets/nodeSecret/bd7375f88ac54de8aedfabfe1c5baf53","attributes":{"enabled":true,"created":1434666405,"updated":1434666405}}, { 'cache-control': 'no-cache', - pragma: 'no-cache', - 'content-type': 'application/json; charset=utf-8', - expires: '-1', - server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.96', - 'x-aspnet-version': '4.0.30319', - 'x-powered-by': 'ASP.NET', - 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Thu, 18 Jun 2015 22:26:46 GMT', - connection: 'close', - 'content-length': '185' }); - return result; }, -function (nock) { -var result = -nock('https://nodesdktest.vault.azure.net:443') - .get('/secrets/nodeSecret/bd7375f88ac54de8aedfabfe1c5baf53?api-version=2015-06-01') - .reply(200, {"value":"Pa$$w0rd","id":"https://nodesdktest.vault.azure.net/secrets/nodeSecret/bd7375f88ac54de8aedfabfe1c5baf53","attributes":{"enabled":true,"created":1434666405,"updated":1434666405}}, { 'cache-control': 'no-cache', - pragma: 'no-cache', - 'content-type': 'application/json; charset=utf-8', - expires: '-1', - server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.96', - 'x-aspnet-version': '4.0.30319', - 'x-powered-by': 'ASP.NET', - 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Thu, 18 Jun 2015 22:26:46 GMT', - connection: 'close', - 'content-length': '185' }); - return result; }, -function (nock) { -var result = -nock('http://nodesdktest.vault.azure.net:443') +nock('http://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) -.patch('/secrets/nodeSecret?api-version=2015-06-01', '*') - .reply(200, {"contentType":"text/plain","id":"https://nodesdktest.vault.azure.net/secrets/nodeSecret/bd7375f88ac54de8aedfabfe1c5baf53","attributes":{"enabled":true,"exp":2527401600,"created":1434666405,"updated":1434666406},"tags":{"foo":"ede2c2613ab96101ef90e0f93ed400417324724f8d0793cc46156eb21c83a50b2aa6d24fbbdce46d3a06ef47b671ba579248"}}, { 'cache-control': 'no-cache', +.patch('/secrets/nodeSecret/7a63db27897e44e88c9ff02d709002a8?api-version=2015-06-01', '*') + .reply(200, "{\"contentType\":\"text/plain\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeSecret/7a63db27897e44e88c9ff02d709002a8\",\"attributes\":{\"enabled\":true,\"exp\":2527401600,\"created\":1470959487,\"updated\":1470959489},\"tags\":{\"foo\":\"1c2113c5908b1633b597923b338e697e6396c6b61dea3431fd058d6efb89d103d134e7d6c14ec3c37686dccf447009884afa\"}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.96', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '130e9517-ae69-4050-aeec-b3a390b6b5c2', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Thu, 18 Jun 2015 22:26:46 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:28 GMT', connection: 'close', - 'content-length': '328' }); + 'content-length': '335' }); return result; }, function (nock) { var result = -nock('https://nodesdktest.vault.azure.net:443') +nock('https://sdktestvault0511.vault.azure.net') .filteringRequestBody(function (path) { return '*';}) -.patch('/secrets/nodeSecret?api-version=2015-06-01', '*') - .reply(200, {"contentType":"text/plain","id":"https://nodesdktest.vault.azure.net/secrets/nodeSecret/bd7375f88ac54de8aedfabfe1c5baf53","attributes":{"enabled":true,"exp":2527401600,"created":1434666405,"updated":1434666406},"tags":{"foo":"ede2c2613ab96101ef90e0f93ed400417324724f8d0793cc46156eb21c83a50b2aa6d24fbbdce46d3a06ef47b671ba579248"}}, { 'cache-control': 'no-cache', +.patch('/secrets/nodeSecret/7a63db27897e44e88c9ff02d709002a8?api-version=2015-06-01', '*') + .reply(200, "{\"contentType\":\"text/plain\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeSecret/7a63db27897e44e88c9ff02d709002a8\",\"attributes\":{\"enabled\":true,\"exp\":2527401600,\"created\":1470959487,\"updated\":1470959489},\"tags\":{\"foo\":\"1c2113c5908b1633b597923b338e697e6396c6b61dea3431fd058d6efb89d103d134e7d6c14ec3c37686dccf447009884afa\"}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.96', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '130e9517-ae69-4050-aeec-b3a390b6b5c2', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Thu, 18 Jun 2015 22:26:46 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:28 GMT', connection: 'close', - 'content-length': '328' }); + 'content-length': '335' }); return result; }, function (nock) { var result = -nock('http://nodesdktest.vault.azure.net:443') - .filteringRequestBody(function (path) { return '*';}) -.patch('/secrets/nodeSecret/bd7375f88ac54de8aedfabfe1c5baf53?api-version=2015-06-01', '*') - .reply(200, {"contentType":"text/plain","id":"https://nodesdktest.vault.azure.net/secrets/nodeSecret/bd7375f88ac54de8aedfabfe1c5baf53","attributes":{"enabled":true,"exp":2527401600,"created":1434666405,"updated":1434666407},"tags":{"foo":"1c2113c5908b1633b597923b338e697e6396c6b61dea3431fd058d6efb89d103d134e7d6c14ec3c37686dccf447009884afa"}}, { 'cache-control': 'no-cache', - pragma: 'no-cache', - 'content-type': 'application/json; charset=utf-8', - expires: '-1', - server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.96', - 'x-aspnet-version': '4.0.30319', - 'x-powered-by': 'ASP.NET', - 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Thu, 18 Jun 2015 22:26:46 GMT', - connection: 'close', - 'content-length': '328' }); - return result; }, -function (nock) { -var result = -nock('https://nodesdktest.vault.azure.net:443') - .filteringRequestBody(function (path) { return '*';}) -.patch('/secrets/nodeSecret/bd7375f88ac54de8aedfabfe1c5baf53?api-version=2015-06-01', '*') - .reply(200, {"contentType":"text/plain","id":"https://nodesdktest.vault.azure.net/secrets/nodeSecret/bd7375f88ac54de8aedfabfe1c5baf53","attributes":{"enabled":true,"exp":2527401600,"created":1434666405,"updated":1434666407},"tags":{"foo":"1c2113c5908b1633b597923b338e697e6396c6b61dea3431fd058d6efb89d103d134e7d6c14ec3c37686dccf447009884afa"}}, { 'cache-control': 'no-cache', - pragma: 'no-cache', - 'content-type': 'application/json; charset=utf-8', - expires: '-1', - server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.96', - 'x-aspnet-version': '4.0.30319', - 'x-powered-by': 'ASP.NET', - 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Thu, 18 Jun 2015 22:26:46 GMT', - connection: 'close', - 'content-length': '328' }); - return result; }, -function (nock) { -var result = -nock('http://nodesdktest.vault.azure.net:443') +nock('http://sdktestvault0511.vault.azure.net') .delete('/secrets/nodeSecret?api-version=2015-06-01') - .reply(200, {"contentType":"text/plain","id":"https://nodesdktest.vault.azure.net/secrets/nodeSecret/bd7375f88ac54de8aedfabfe1c5baf53","attributes":{"enabled":true,"exp":2527401600,"created":1434666405,"updated":1434666407},"tags":{"foo":"1c2113c5908b1633b597923b338e697e6396c6b61dea3431fd058d6efb89d103d134e7d6c14ec3c37686dccf447009884afa"}}, { 'cache-control': 'no-cache', + .reply(200, "{\"contentType\":\"text/plain\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeSecret/7a63db27897e44e88c9ff02d709002a8\",\"attributes\":{\"enabled\":true,\"exp\":2527401600,\"created\":1470959487,\"updated\":1470959489},\"tags\":{\"foo\":\"1c2113c5908b1633b597923b338e697e6396c6b61dea3431fd058d6efb89d103d134e7d6c14ec3c37686dccf447009884afa\"}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.96', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '32d4fa58-d6b1-4cdc-9383-1c09827fbe41', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Thu, 18 Jun 2015 22:26:48 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:28 GMT', connection: 'close', - 'content-length': '328' }); + 'content-length': '335' }); return result; }, function (nock) { var result = -nock('https://nodesdktest.vault.azure.net:443') +nock('https://sdktestvault0511.vault.azure.net') .delete('/secrets/nodeSecret?api-version=2015-06-01') - .reply(200, {"contentType":"text/plain","id":"https://nodesdktest.vault.azure.net/secrets/nodeSecret/bd7375f88ac54de8aedfabfe1c5baf53","attributes":{"enabled":true,"exp":2527401600,"created":1434666405,"updated":1434666407},"tags":{"foo":"1c2113c5908b1633b597923b338e697e6396c6b61dea3431fd058d6efb89d103d134e7d6c14ec3c37686dccf447009884afa"}}, { 'cache-control': 'no-cache', + .reply(200, "{\"contentType\":\"text/plain\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeSecret/7a63db27897e44e88c9ff02d709002a8\",\"attributes\":{\"enabled\":true,\"exp\":2527401600,\"created\":1470959487,\"updated\":1470959489},\"tags\":{\"foo\":\"1c2113c5908b1633b597923b338e697e6396c6b61dea3431fd058d6efb89d103d134e7d6c14ec3c37686dccf447009884afa\"}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.96', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '32d4fa58-d6b1-4cdc-9383-1c09827fbe41', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Thu, 18 Jun 2015 22:26:48 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:28 GMT', connection: 'close', - 'content-length': '328' }); + 'content-length': '335' }); return result; }, function (nock) { var result = -nock('http://nodesdktest.vault.azure.net:443') - .get('/secrets/nodeSecret?api-version=2015-06-01') - .reply(404, {"error":{"code":"SecretNotFound","message":"Secret not found: nodeSecret"}}, { 'cache-control': 'no-cache', +nock('http://sdktestvault0511.vault.azure.net') + .get('/secrets/nodeSecret/?api-version=2015-06-01') + .reply(404, "{\"error\":{\"code\":\"SecretNotFound\",\"message\":\"Secret not found: nodeSecret\"}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-length': '76', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.96', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '124ca36b-c868-4ec6-ae7c-07cab92105d5', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Thu, 18 Jun 2015 22:26:47 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:29 GMT', connection: 'close' }); return result; }, function (nock) { var result = -nock('https://nodesdktest.vault.azure.net:443') - .get('/secrets/nodeSecret?api-version=2015-06-01') - .reply(404, {"error":{"code":"SecretNotFound","message":"Secret not found: nodeSecret"}}, { 'cache-control': 'no-cache', +nock('https://sdktestvault0511.vault.azure.net') + .get('/secrets/nodeSecret/?api-version=2015-06-01') + .reply(404, "{\"error\":{\"code\":\"SecretNotFound\",\"message\":\"Secret not found: nodeSecret\"}}", { 'cache-control': 'no-cache', pragma: 'no-cache', 'content-length': '76', 'content-type': 'application/json; charset=utf-8', expires: '-1', server: 'Microsoft-IIS/8.5', - 'x-ms-keyvault-service-version': '1.0.0.96', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '124ca36b-c868-4ec6-ae7c-07cab92105d5', + 'x-ms-keyvault-service-version': '1.0.0.765', 'x-aspnet-version': '4.0.30319', 'x-powered-by': 'ASP.NET', 'strict-transport-security': 'max-age=31536000;includeSubDomains', - date: 'Thu, 18 Jun 2015 22:26:47 GMT', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:29 GMT', connection: 'close' }); + return result; }], +[function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.put('/secrets/nodeSecret1?api-version=2015-06-01', '*') + .reply(200, "{\"value\":\"Pa$$w0rd\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeSecret1/67f1e065e6064640b8e3a9cbffff1bf0\",\"attributes\":{\"enabled\":true,\"created\":1470959490,\"updated\":1470959490}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '9717a490-890f-4dbf-a4b8-05314d1a3f34', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:30 GMT', + connection: 'close', + 'content-length': '193' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.put('/secrets/nodeSecret1?api-version=2015-06-01', '*') + .reply(200, "{\"value\":\"Pa$$w0rd\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeSecret1/67f1e065e6064640b8e3a9cbffff1bf0\",\"attributes\":{\"enabled\":true,\"created\":1470959490,\"updated\":1470959490}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '9717a490-890f-4dbf-a4b8-05314d1a3f34', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:30 GMT', + connection: 'close', + 'content-length': '193' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.put('/secrets/nodeSecret2?api-version=2015-06-01', '*') + .reply(200, "{\"value\":\"Pa$$w0rd\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeSecret2/212024b00e4e472c8afe578b33a89062\",\"attributes\":{\"enabled\":true,\"created\":1470959490,\"updated\":1470959490}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '24cebe8f-37e7-4515-bc80-fbe7c5599d0a', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:30 GMT', + connection: 'close', + 'content-length': '193' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.put('/secrets/nodeSecret2?api-version=2015-06-01', '*') + .reply(200, "{\"value\":\"Pa$$w0rd\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeSecret2/212024b00e4e472c8afe578b33a89062\",\"attributes\":{\"enabled\":true,\"created\":1470959490,\"updated\":1470959490}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '24cebe8f-37e7-4515-bc80-fbe7c5599d0a', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:30 GMT', + connection: 'close', + 'content-length': '193' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/secrets?maxresults=2&api-version=2015-06-01') + .reply(200, "{\"value\":[{\"contentType\":\"application/x-pkcs12\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/createManualEnrollmentJava4\",\"managed\":true,\"attributes\":{\"enabled\":true,\"nbf\":1469048531,\"exp\":1500585131,\"created\":1469049131,\"updated\":1469049131}},{\"contentType\":\"application/x-pkcs12\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/createManualEnrollmentJava6\",\"managed\":true,\"attributes\":{\"enabled\":true,\"nbf\":1469567919,\"exp\":1501104519,\"created\":1469568520,\"updated\":1469568520}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/secrets?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDQhTURBd01ETTBJWE5sWTNKbGRDOURVa1ZCVkVWTlFVNVZRVXhGVGxKUFRFeE5SVTVVU2tGV1FUY2hNREF3TURJNElUazVPVGt0TVRJdE16RlVNak02TlRrNk5Ua3VPVGs1T1RrNU9Wb2giLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '1c0b8591-9838-4560-be77-10e0927a97fa', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:31 GMT', + connection: 'close', + 'content-length': '808' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/secrets?maxresults=2&api-version=2015-06-01') + .reply(200, "{\"value\":[{\"contentType\":\"application/x-pkcs12\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/createManualEnrollmentJava4\",\"managed\":true,\"attributes\":{\"enabled\":true,\"nbf\":1469048531,\"exp\":1500585131,\"created\":1469049131,\"updated\":1469049131}},{\"contentType\":\"application/x-pkcs12\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/createManualEnrollmentJava6\",\"managed\":true,\"attributes\":{\"enabled\":true,\"nbf\":1469567919,\"exp\":1501104519,\"created\":1469568520,\"updated\":1469568520}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/secrets?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDQhTURBd01ETTBJWE5sWTNKbGRDOURVa1ZCVkVWTlFVNVZRVXhGVGxKUFRFeE5SVTVVU2tGV1FUY2hNREF3TURJNElUazVPVGt0TVRJdE16RlVNak02TlRrNk5Ua3VPVGs1T1RrNU9Wb2giLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '1c0b8591-9838-4560-be77-10e0927a97fa', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:31 GMT', + connection: 'close', + 'content-length': '808' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/secrets?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDQhTURBd01ETTBJWE5sWTNKbGRDOURVa1ZCVkVWTlFVNVZRVXhGVGxKUFRFeE5SVTVVU2tGV1FUY2hNREF3TURJNElUazVPVGt0TVRJdE16RlVNak02TlRrNk5Ua3VPVGs1T1RrNU9Wb2giLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2') + .reply(200, "{\"value\":[{\"contentType\":\"application/x-pkcs12\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/createManualEnrollmentJava7\",\"managed\":true,\"attributes\":{\"enabled\":true,\"nbf\":1469568292,\"exp\":1501104892,\"created\":1469568892,\"updated\":1469568892}},{\"contentType\":\"application/x-pkcs12\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/createManualEnrollmentJava8\",\"managed\":true,\"attributes\":{\"enabled\":true,\"nbf\":1469569754,\"exp\":1501106354,\"created\":1469570354,\"updated\":1469570354}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/secrets?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDQhTURBd01ETTBJWE5sWTNKbGRDOURVa1ZCVkVWTlFVNVZRVXhGVGxKUFRFeE5SVTVVU2tGV1FUa2hNREF3TURJNElUazVPVGt0TVRJdE16RlVNak02TlRrNk5Ua3VPVGs1T1RrNU9Wb2giLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '60c38c1c-2a16-4dd6-b3b2-625bf41154c0', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:30 GMT', + connection: 'close', + 'content-length': '808' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/secrets?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDQhTURBd01ETTBJWE5sWTNKbGRDOURVa1ZCVkVWTlFVNVZRVXhGVGxKUFRFeE5SVTVVU2tGV1FUY2hNREF3TURJNElUazVPVGt0TVRJdE16RlVNak02TlRrNk5Ua3VPVGs1T1RrNU9Wb2giLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2') + .reply(200, "{\"value\":[{\"contentType\":\"application/x-pkcs12\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/createManualEnrollmentJava7\",\"managed\":true,\"attributes\":{\"enabled\":true,\"nbf\":1469568292,\"exp\":1501104892,\"created\":1469568892,\"updated\":1469568892}},{\"contentType\":\"application/x-pkcs12\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/createManualEnrollmentJava8\",\"managed\":true,\"attributes\":{\"enabled\":true,\"nbf\":1469569754,\"exp\":1501106354,\"created\":1469570354,\"updated\":1469570354}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/secrets?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDQhTURBd01ETTBJWE5sWTNKbGRDOURVa1ZCVkVWTlFVNVZRVXhGVGxKUFRFeE5SVTVVU2tGV1FUa2hNREF3TURJNElUazVPVGt0TVRJdE16RlVNak02TlRrNk5Ua3VPVGs1T1RrNU9Wb2giLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '60c38c1c-2a16-4dd6-b3b2-625bf41154c0', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:30 GMT', + connection: 'close', + 'content-length': '808' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/secrets?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDQhTURBd01ETTBJWE5sWTNKbGRDOURVa1ZCVkVWTlFVNVZRVXhGVGxKUFRFeE5SVTVVU2tGV1FUa2hNREF3TURJNElUazVPVGt0TVRJdE16RlVNak02TlRrNk5Ua3VPVGs1T1RrNU9Wb2giLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2') + .reply(200, "{\"value\":[{\"contentType\":\"application/x-pkcs12\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/createManualEnrollmentJava9\",\"managed\":true,\"attributes\":{\"enabled\":true,\"nbf\":1469574262,\"exp\":1501110862,\"created\":1469574863,\"updated\":1469574863}},{\"contentType\":\"application/x-pkcs12\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/importListCertificate1\",\"managed\":true,\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470959365,\"updated\":1470959365}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/secrets?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDAhTURBd01ESTVJWE5sWTNKbGRDOUpUVkJQVWxSTVNWTlVRMFZTVkVsR1NVTkJWRVV5SVRBd01EQXlPQ0U1T1RrNUxURXlMVE14VkRJek9qVTVPalU1TGprNU9UazVPVGxhSVEtLSIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'd5637ccd-37b7-4bd4-992c-ea6c4989ad23', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:31 GMT', + connection: 'close', + 'content-length': '798' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/secrets?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDQhTURBd01ETTBJWE5sWTNKbGRDOURVa1ZCVkVWTlFVNVZRVXhGVGxKUFRFeE5SVTVVU2tGV1FUa2hNREF3TURJNElUazVPVGt0TVRJdE16RlVNak02TlRrNk5Ua3VPVGs1T1RrNU9Wb2giLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2') + .reply(200, "{\"value\":[{\"contentType\":\"application/x-pkcs12\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/createManualEnrollmentJava9\",\"managed\":true,\"attributes\":{\"enabled\":true,\"nbf\":1469574262,\"exp\":1501110862,\"created\":1469574863,\"updated\":1469574863}},{\"contentType\":\"application/x-pkcs12\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/importListCertificate1\",\"managed\":true,\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470959365,\"updated\":1470959365}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/secrets?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDAhTURBd01ESTVJWE5sWTNKbGRDOUpUVkJQVWxSTVNWTlVRMFZTVkVsR1NVTkJWRVV5SVRBd01EQXlPQ0U1T1RrNUxURXlMVE14VkRJek9qVTVPalU1TGprNU9UazVPVGxhSVEtLSIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'd5637ccd-37b7-4bd4-992c-ea6c4989ad23', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:31 GMT', + connection: 'close', + 'content-length': '798' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/secrets?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDAhTURBd01ESTVJWE5sWTNKbGRDOUpUVkJQVWxSTVNWTlVRMFZTVkVsR1NVTkJWRVV5SVRBd01EQXlPQ0U1T1RrNUxURXlMVE14VkRJek9qVTVPalU1TGprNU9UazVPVGxhSVEtLSIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"contentType\":\"application/x-pkcs12\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/importListCertificate2\",\"managed\":true,\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470959367,\"updated\":1470959367}},{\"contentType\":\"application/x-pkcs12\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/importListVersionCerts\",\"managed\":true,\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470959376,\"updated\":1470959376}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/secrets?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4NCFNREF3TURFM0lYTmxZM0psZEM5S1FWWkJVMFZEVWtWVUlUQXdNREF5T0NFeU1ERTJMVEE0TFRBNVZESXdPakkwT2pBeExqUXhPVE00TURSYUlRLS0iLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '1d0f5161-b7d0-4fb6-a491-a017f8c48717', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:31 GMT', + connection: 'close', + 'content-length': '770' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/secrets?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMDAhTURBd01ESTVJWE5sWTNKbGRDOUpUVkJQVWxSTVNWTlVRMFZTVkVsR1NVTkJWRVV5SVRBd01EQXlPQ0U1T1RrNUxURXlMVE14VkRJek9qVTVPalU1TGprNU9UazVPVGxhSVEtLSIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"contentType\":\"application/x-pkcs12\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/importListCertificate2\",\"managed\":true,\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470959367,\"updated\":1470959367}},{\"contentType\":\"application/x-pkcs12\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/importListVersionCerts\",\"managed\":true,\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470959376,\"updated\":1470959376}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/secrets?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4NCFNREF3TURFM0lYTmxZM0psZEM5S1FWWkJVMFZEVWtWVUlUQXdNREF5T0NFeU1ERTJMVEE0TFRBNVZESXdPakkwT2pBeExqUXhPVE00TURSYUlRLS0iLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '1d0f5161-b7d0-4fb6-a491-a017f8c48717', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:31 GMT', + connection: 'close', + 'content-length': '770' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/secrets?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4NCFNREF3TURFM0lYTmxZM0psZEM5S1FWWkJVMFZEVWtWVUlUQXdNREF5T0NFeU1ERTJMVEE0TFRBNVZESXdPakkwT2pBeExqUXhPVE00TURSYUlRLS0iLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2') + .reply(200, "{\"value\":[{\"contentType\":\"application/x-pkcs12\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/listCertificate0\",\"managed\":true,\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470774077,\"updated\":1470774077}},{\"contentType\":\"application/x-pkcs12\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/listCertificate1\",\"managed\":true,\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470774079,\"updated\":1470774079}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/secrets?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJeklYTmxZM0psZEM5TVNWTlVRMFZTVkVsR1NVTkJWRVV5SVRBd01EQXlPQ0U1T1RrNUxURXlMVE14VkRJek9qVTVPalU1TGprNU9UazVPVGxhSVEtLSIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '7cdd76cd-1732-4964-af7f-18b5fd36d4fa', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:32 GMT', + connection: 'close', + 'content-length': '769' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/secrets?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4NCFNREF3TURFM0lYTmxZM0psZEM5S1FWWkJVMFZEVWtWVUlUQXdNREF5T0NFeU1ERTJMVEE0TFRBNVZESXdPakkwT2pBeExqUXhPVE00TURSYUlRLS0iLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2') + .reply(200, "{\"value\":[{\"contentType\":\"application/x-pkcs12\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/listCertificate0\",\"managed\":true,\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470774077,\"updated\":1470774077}},{\"contentType\":\"application/x-pkcs12\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/listCertificate1\",\"managed\":true,\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470774079,\"updated\":1470774079}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/secrets?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJeklYTmxZM0psZEM5TVNWTlVRMFZTVkVsR1NVTkJWRVV5SVRBd01EQXlPQ0U1T1RrNUxURXlMVE14VkRJek9qVTVPalU1TGprNU9UazVPVGxhSVEtLSIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '7cdd76cd-1732-4964-af7f-18b5fd36d4fa', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:32 GMT', + connection: 'close', + 'content-length': '769' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/secrets?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJeklYTmxZM0psZEM5TVNWTlVRMFZTVkVsR1NVTkJWRVV5SVRBd01EQXlPQ0U1T1RrNUxURXlMVE14VkRJek9qVTVPalU1TGprNU9UazVPVGxhSVEtLSIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"contentType\":\"application/x-pkcs12\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/listCertificate2\",\"managed\":true,\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470774080,\"updated\":1470774080}},{\"contentType\":\"application/x-pkcs12\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/listCertificate3\",\"managed\":true,\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470774081,\"updated\":1470774081}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/secrets?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4OCFNREF3TURJeUlYTmxZM0psZEM5T1QwUkZRMFZTVkVsR1NVTkJWRVVoTURBd01ESTRJVGs1T1RrdE1USXRNekZVTWpNNk5UazZOVGt1T1RrNU9UazVPVm9oIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '52a9de3f-8f65-4839-b781-e62feaeb8d37', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:32 GMT', + connection: 'close', + 'content-length': '763' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/secrets?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE5MiFNREF3TURJeklYTmxZM0psZEM5TVNWTlVRMFZTVkVsR1NVTkJWRVV5SVRBd01EQXlPQ0U1T1RrNUxURXlMVE14VkRJek9qVTVPalU1TGprNU9UazVPVGxhSVEtLSIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=2') + .reply(200, "{\"value\":[{\"contentType\":\"application/x-pkcs12\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/listCertificate2\",\"managed\":true,\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470774080,\"updated\":1470774080}},{\"contentType\":\"application/x-pkcs12\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/listCertificate3\",\"managed\":true,\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470774081,\"updated\":1470774081}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/secrets?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4OCFNREF3TURJeUlYTmxZM0psZEM5T1QwUkZRMFZTVkVsR1NVTkJWRVVoTURBd01ESTRJVGs1T1RrdE1USXRNekZVTWpNNk5UazZOVGt1T1RrNU9UazVPVm9oIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '52a9de3f-8f65-4839-b781-e62feaeb8d37', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:32 GMT', + connection: 'close', + 'content-length': '763' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/secrets?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4OCFNREF3TURJeUlYTmxZM0psZEM5T1QwUkZRMFZTVkVsR1NVTkJWRVVoTURBd01ESTRJVGs1T1RrdE1USXRNekZVTWpNNk5UazZOVGt1T1RrNU9UazVPVm9oIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2') + .reply(200, "{\"value\":[{\"contentType\":\"application/x-pkcs12\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeImportCertificate\",\"managed\":true,\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470959363,\"updated\":1470959363}},{\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeSecret1\",\"attributes\":{\"enabled\":true,\"created\":1470959490,\"updated\":1470959490}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/secrets?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4NCFNREF3TURFNElYTmxZM0psZEM5T1QwUkZVMFZEVWtWVU1pRXdNREF3TWpnaE9UazVPUzB4TWkwek1WUXlNem8xT1RvMU9TNDVPVGs1T1RrNVdpRS0iLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '9c1eec7e-d43a-45a4-9894-3b691bad6aee', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:33 GMT', + connection: 'close', + 'content-length': '672' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/secrets?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4OCFNREF3TURJeUlYTmxZM0psZEM5T1QwUkZRMFZTVkVsR1NVTkJWRVVoTURBd01ESTRJVGs1T1RrdE1USXRNekZVTWpNNk5UazZOVGt1T1RrNU9UazVPVm9oIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2') + .reply(200, "{\"value\":[{\"contentType\":\"application/x-pkcs12\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeImportCertificate\",\"managed\":true,\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470959363,\"updated\":1470959363}},{\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeSecret1\",\"attributes\":{\"enabled\":true,\"created\":1470959490,\"updated\":1470959490}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/secrets?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4NCFNREF3TURFNElYTmxZM0psZEM5T1QwUkZVMFZEVWtWVU1pRXdNREF3TWpnaE9UazVPUzB4TWkwek1WUXlNem8xT1RvMU9TNDVPVGs1T1RrNVdpRS0iLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '9c1eec7e-d43a-45a4-9894-3b691bad6aee', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:33 GMT', + connection: 'close', + 'content-length': '672' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/secrets?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4NCFNREF3TURFNElYTmxZM0psZEM5T1QwUkZVMFZEVWtWVU1pRXdNREF3TWpnaE9UazVPUzB4TWkwek1WUXlNem8xT1RvMU9TNDVPVGs1T1RrNVdpRS0iLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeSecret2\",\"attributes\":{\"enabled\":true,\"created\":1470959490,\"updated\":1470959490}},{\"contentType\":\"application/x-pkcs12\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/policyCertificate\",\"managed\":true,\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470959397,\"updated\":1470959397}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/secrets?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE3NiFNREF3TURFeElYTmxZM0psZEM5VFJVTXhJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '2c0d5611-0155-4a6c-a58b-cd5763da086f', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:34 GMT', + connection: 'close', + 'content-length': '657' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/secrets?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4NCFNREF3TURFNElYTmxZM0psZEM5T1QwUkZVMFZEVWtWVU1pRXdNREF3TWpnaE9UazVPUzB4TWkwek1WUXlNem8xT1RvMU9TNDVPVGs1T1RrNVdpRS0iLCJUYXJnZXRMb2NhdGlvbiI6MH0&maxresults=2') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeSecret2\",\"attributes\":{\"enabled\":true,\"created\":1470959490,\"updated\":1470959490}},{\"contentType\":\"application/x-pkcs12\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/policyCertificate\",\"managed\":true,\"attributes\":{\"enabled\":true,\"nbf\":1430344421,\"exp\":2208988799,\"created\":1470959397,\"updated\":1470959397}}],\"nextLink\":\"https://sdktestvault0511.vault.azure.net:443/secrets?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE3NiFNREF3TURFeElYTmxZM0psZEM5VFJVTXhJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2\"}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '2c0d5611-0155-4a6c-a58b-cd5763da086f', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:34 GMT', + connection: 'close', + 'content-length': '657' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/secrets?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE3NiFNREF3TURFeElYTmxZM0psZEM5VFJVTXhJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2') + .reply(200, "{\"value\":[{\"contentType\":\"application/x-pkcs12\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/UnknownIssuerCert\",\"managed\":true,\"attributes\":{\"enabled\":true,\"nbf\":1469493191,\"exp\":1501029791,\"created\":1469493792,\"updated\":1469493792}}],\"nextLink\":null}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'b5532415-9514-4919-8e49-910d70b592cf', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:34 GMT', + connection: 'close', + 'content-length': '261' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/secrets?api-version=2015-06-01&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE3NiFNREF3TURFeElYTmxZM0psZEM5VFJVTXhJVEF3TURBeU9DRTVPVGs1TFRFeUxUTXhWREl6T2pVNU9qVTVMams1T1RrNU9UbGFJUS0tIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=2') + .reply(200, "{\"value\":[{\"contentType\":\"application/x-pkcs12\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/UnknownIssuerCert\",\"managed\":true,\"attributes\":{\"enabled\":true,\"nbf\":1469493191,\"exp\":1501029791,\"created\":1469493792,\"updated\":1469493792}}],\"nextLink\":null}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'b5532415-9514-4919-8e49-910d70b592cf', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:34 GMT', + connection: 'close', + 'content-length': '261' }); + return result; }], +[function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.put('/secrets/nodeSecret?api-version=2015-06-01', '*') + .reply(200, "{\"value\":\"Pa$$w0rd\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeSecret/3062b6588a6f4502b821db8a7ea26488\",\"attributes\":{\"enabled\":true,\"created\":1470959495,\"updated\":1470959495}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '3c932563-a547-48da-b664-552021a2bb61', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:34 GMT', + connection: 'close', + 'content-length': '192' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.put('/secrets/nodeSecret?api-version=2015-06-01', '*') + .reply(200, "{\"value\":\"Pa$$w0rd\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeSecret/3062b6588a6f4502b821db8a7ea26488\",\"attributes\":{\"enabled\":true,\"created\":1470959495,\"updated\":1470959495}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': '3c932563-a547-48da-b664-552021a2bb61', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:34 GMT', + connection: 'close', + 'content-length': '192' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.put('/secrets/nodeSecret?api-version=2015-06-01', '*') + .reply(200, "{\"value\":\"Pa$$w0rd\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeSecret/811957d9309f4f67b48bc67d6c01b234\",\"attributes\":{\"enabled\":true,\"created\":1470959495,\"updated\":1470959495}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'd36265fa-c491-4bb6-a257-bbcf02e7230f', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:35 GMT', + connection: 'close', + 'content-length': '192' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .filteringRequestBody(function (path) { return '*';}) +.put('/secrets/nodeSecret?api-version=2015-06-01', '*') + .reply(200, "{\"value\":\"Pa$$w0rd\",\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeSecret/811957d9309f4f67b48bc67d6c01b234\",\"attributes\":{\"enabled\":true,\"created\":1470959495,\"updated\":1470959495}}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'd36265fa-c491-4bb6-a257-bbcf02e7230f', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:35 GMT', + connection: 'close', + 'content-length': '192' }); + return result; }, +function (nock) { +var result = +nock('http://sdktestvault0511.vault.azure.net') + .get('/secrets/nodeSecret/versions?api-version=2015-06-01') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeSecret/3062b6588a6f4502b821db8a7ea26488\",\"attributes\":{\"enabled\":true,\"created\":1470959495,\"updated\":1470959495}},{\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeSecret/811957d9309f4f67b48bc67d6c01b234\",\"attributes\":{\"enabled\":true,\"created\":1470959495,\"updated\":1470959495}}],\"nextLink\":null}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'd9ef7e11-473e-416b-befb-7a7fa84f406e', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:35 GMT', + connection: 'close', + 'content-length': '375' }); + return result; }, +function (nock) { +var result = +nock('https://sdktestvault0511.vault.azure.net') + .get('/secrets/nodeSecret/versions?api-version=2015-06-01') + .reply(200, "{\"value\":[{\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeSecret/3062b6588a6f4502b821db8a7ea26488\",\"attributes\":{\"enabled\":true,\"created\":1470959495,\"updated\":1470959495}},{\"id\":\"https://sdktestvault0511.vault.azure.net/secrets/nodeSecret/811957d9309f4f67b48bc67d6c01b234\",\"attributes\":{\"enabled\":true,\"created\":1470959495,\"updated\":1470959495}}],\"nextLink\":null}", { 'cache-control': 'no-cache', + pragma: 'no-cache', + 'content-type': 'application/json; charset=utf-8', + expires: '-1', + server: 'Microsoft-IIS/8.5', + 'x-ms-keyvault-region': 'East US', + 'x-ms-request-id': 'd9ef7e11-473e-416b-befb-7a7fa84f406e', + 'x-ms-keyvault-service-version': '1.0.0.765', + 'x-aspnet-version': '4.0.30319', + 'x-powered-by': 'ASP.NET', + 'strict-transport-security': 'max-age=31536000;includeSubDomains', + 'x-content-type-options': 'nosniff', + date: 'Thu, 11 Aug 2016 23:51:35 GMT', + connection: 'close', + 'content-length': '375' }); return result; }]]; \ No newline at end of file diff --git a/test/services/keyVault/keyVault-certificate-tests.js b/test/services/keyVault/keyVault-certificate-tests.js new file mode 100644 index 000000000..12ef0eb29 --- /dev/null +++ b/test/services/keyVault/keyVault-certificate-tests.js @@ -0,0 +1,868 @@ +// +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// + +'use strict'; + +var Testutil = require('../../util/util'); +var KeyVault = Testutil.libRequire('services/keyVault'); +var MockedTestUtils = require('../../framework/mocked-test-utils'); +var KvUtils = require('./kv-test-utils.js'); +var Crypto = require('crypto'); +var util = require('util'); +var should = require('should'); + +var series = KvUtils.series; +var validateCertificateOperation = KvUtils.validateCertificateOperation +var validateCertificateBundle = KvUtils.validateCertificateBundle; +var validateIssuerBundle = KvUtils.validateIssuerBundle; +var validateCertificateContacts = KvUtils.validateCertificateContacts; +var validateCertificateList = KvUtils.validateCertificateList; +var validateCertificateIssuerList = KvUtils.validateCertificateIssuerList; +var assertExactly = KvUtils.assertExactly; +var compareObjects = KvUtils.compareObjects; + +var vaultUri = process.env['AZURE_KV_VAULT']; +if (!vaultUri) { + vaultUri = 'https://sdktestvault0511.vault.azure.net'; +} + +var CERTIFICATE_NAME = 'nodeCertificate'; +var ISSUER_NAME = 'nodeIssuer'; +var LIST_TEST_SIZE = 2; + +describe('Key Vault certificates', function () { + + var client; + var suiteUtil; + + before(function (done) { + var credentials = new KeyVault.KeyVaultCredentials(KvUtils.authenticator); + client = new KeyVault.KeyVaultClient(credentials); + + suiteUtil = new MockedTestUtils(client, 'keyVault-certificate-tests'); + suiteUtil.setupSuite(done); + }); + + after(function (done) { + cleanupCreatedCertificates(function () { + suiteUtil.teardownSuite(done); + }); + }); + + beforeEach(function (done) { + suiteUtil.setupTest(done); + }); + + afterEach(function (done) { + suiteUtil.baseTeardownTest(done); + }); + + describe('identifier', function () { + it('should work', function (done) { + + function assertCertificateMatch(vault, name, version, Id) { + + assertExactly(util.format('%s/certificates/%s', vault, name), Id.baseIdentifier); + if (version) { + assertExactly(util.format('%s/certificates/%s/%s', vault, name, version), Id.identifier); + } else { + assertExactly(Id.baseIdentifier, Id.identifier); + } + assertExactly(vault, Id.vault); + assertExactly(name, Id.name); + assertExactly(version, Id.version); + } + + function verifyCertificateCreate(vault, name, version) { + var Id, parsedId; + if (version) { + Id = KeyVault.createCertificateIdentifier(vault, name, version); + } else { + Id = KeyVault.createCertificateIdentifier(vault, name); + } + assertCertificateMatch(vault, name, version, Id); + if (version) { + parsedId = KeyVault.parseCertificateIdentifier(Id.identifier); + assertCertificateMatch(vault, name, version, parsedId); + } + parsedId = KeyVault.parseCertificateIdentifier(Id.baseIdentifier); + assertCertificateMatch(vault, name, null, parsedId); + } + + function assertCertificateOperationMatch(vault, name, Id) { + assertExactly(util.format('%s/certificates/%s/pending', vault, name), Id.baseIdentifier); + assertExactly(Id.baseIdentifier, Id.identifier); + + assertExactly(vault, Id.vault); + assertExactly(name, Id.name); + assertExactly(null, Id.version); + } + + function verifyCertificateOperationCreate(vault, name) { + var Id, parsedId; + Id = KeyVault.createCertificateOperationIdentifier(vault, name); + + assertCertificateOperationMatch(vault, name, Id); + parsedId = KeyVault.parseCertificateOperationIdentifier(Id.baseIdentifier); + assertCertificateOperationMatch(vault, name, parsedId); + } + + function assertIssuerMatch(vault, name, Id) { + assertExactly(util.format('%s/certificates/issuers/%s', vault, name), Id.baseIdentifier); + assertExactly(Id.baseIdentifier, Id.identifier); + + assertExactly(vault, Id.vault); + assertExactly(name, Id.name); + assertExactly(null, Id.version); + } + + function verifyIssuerCreate(vault, name) { + var Id, parsedId; + Id = KeyVault.createIssuerIdentifier(vault, name); + + assertIssuerMatch(vault, name, Id); + parsedId = KeyVault.parseIssuerIdentifier(Id.baseIdentifier); + assertIssuerMatch(vault, name, parsedId); + } + + verifyCertificateCreate(vaultUri, CERTIFICATE_NAME, null); + verifyCertificateCreate(vaultUri, CERTIFICATE_NAME, '1234'); + + verifyCertificateOperationCreate(vaultUri, CERTIFICATE_NAME); + + verifyIssuerCreate(vaultUri, CERTIFICATE_NAME); + + done(); + + }); + }); + + describe('CRUD certificate', function () { + it('should work', function (done) { + + this.timeout(100000); + + //create delete update get + + var createdBundle; + var certificateId; + var certificatePolicy = { + keyProperties: { + exportable: true, + reuseKey: false, + keySize: 2048, + keyType: 'RSA' + }, + secretProperties: { + contentType: 'application/x-pkcs12' + }, + issuerReference: { + name: 'Self' + }, + x509CertificateProperties: { + subject: 'CN=*.microsoft.com', + subjectAlternativeNames: ["onedrive.microsoft.com", "xbox.microsoft.com"], + validityInMonths: 24 + } + }; + + function createCertificate(next) { + var intervalTime = 5000; + if (suiteUtil.isPlayback) { + intervalTime = 0; + } + client.createCertificate(vaultUri, CERTIFICATE_NAME, { certificatePolicy: certificatePolicy }, function (err, certificateOperation) { + if (err) throw err; + var interval = setInterval(function getCertStatus() { + client.getCertificateOperation(vaultUri, CERTIFICATE_NAME, function (err, pendingCertificate) { + if (err) throw err; + validateCertificateOperation(pendingCertificate, vaultUri, CERTIFICATE_NAME, certificatePolicy); + + if (pendingCertificate.status.toUpperCase() === 'completed'.toUpperCase()) { + clearInterval(interval); + validateCertificateOperation(pendingCertificate, vaultUri, CERTIFICATE_NAME, certificatePolicy); + certificateId = pendingCertificate.target; + next(); + } + else if (pendingCertificate.status.toUpperCase() !== 'InProgress'.toUpperCase()) { + throw new Error('UnKnown status code for pending certificate: ' + util.inspect(pendingCertificate, { depth: null })); + } + }); + }, intervalTime); + }); + } + + function updateCertificate(next) { + certificatePolicy.tags = { 'tag1': 'value1' }; + client.updateCertificate(certificateId, certificatePolicy, function (err, certificateBundle) { + if (err) throw err; + validateCertificateBundle(certificateBundle, vaultUri, CERTIFICATE_NAME, certificatePolicy); + next(); + }); + } + + function getCertificate(next) { + client.getCertificate(certificateId, function (err, certificateBundle) { + if (err) throw err; + + validateCertificateBundle(certificateBundle, vaultUri, CERTIFICATE_NAME, certificatePolicy); + + //Get certificate as secret + client.getSecret(certificateBundle.sid, function (err, secretBundle) { + if (err) throw err; + + next(); + }); + }); + } + + function deleteCertificate(next) { + client.deleteCertificate(vaultUri, CERTIFICATE_NAME, function (err, certificateBundle) { + if (err) throw err; + validateCertificateBundle(certificateBundle, vaultUri, CERTIFICATE_NAME, certificatePolicy); + next(); + }); + } + + function getNoneExistingCertificate(next) { + client.getCertificate(certificateId, function (err, certificateBundle) { + if (!err || !err.code || err.code !== 'CertificateNotFound' || !err.statusCode || err.statusCode !== 404) { + throw new Error('Unexpected error object: ' + JSON.stringify(err, null, ' ')); + } + next(); + }); + } + + series([ + createCertificate, + updateCertificate, + getCertificate, + deleteCertificate, + getNoneExistingCertificate, + function () { done(); } + ]); + + }); + }); + + + describe('import', function () { + it('should work', function (done) { + + this.timeout(10000); + + var CERTIFICATE_NAME = 'nodeImportCertificate'; + + function importCertificate(next) { + importCommonCertificate(CERTIFICATE_NAME, function (err, certificateBundle, certificatePolicy) { + if (err) throw err; + validateCertificateBundle(certificateBundle, vaultUri, CERTIFICATE_NAME, certificatePolicy); + next(); + }); + } + + series([ + importCertificate, + function () { done(); } + ]); + + }); + }); + + describe('list', function () { + it('should work', function (done) { + + this.timeout(100000); + var expected = {}; + + function importSomeCertificates(next) { + importCommonCertificate('importListCertificate1', function (err, certificateBundle) { + if (err) throw err; + expected[KeyVault.parseCertificateIdentifier(certificateBundle.id).baseIdentifier] = certificateBundle.attributes; + + importCommonCertificate('importListCertificate2', function (err, certificateBundle) { + if (err) throw err; + expected[KeyVault.parseCertificateIdentifier(certificateBundle.id).baseIdentifier] = certificateBundle.attributes; + next(); + }); + }); + } + + function listCertificate(next) { + client.getCertificates(vaultUri, { maxresults: LIST_TEST_SIZE }, function (err, certList) { + if (err) throw err; + should(certList.length).be.within(0, LIST_TEST_SIZE); + validateCertificateList(certList, expected); + if (certList.nextLink) { + return getNextCertificates(certList.nextLink); + } + + if (expected.length && expected.length !== 0) { + throw new Error('Not all certificates were returned: ' + JSON.stringify(expected, null, ' ')); + } + next(); + + function getNextCertificates(nextLink) { + client.getCertificatesNext(nextLink, function (err, list) { + if (err) throw err; + validateCertificateList(list, expected); + if (list.nextLink) { + return getNextCertificates(list.nextLink); + } + if (expected.length && expected.length !== 0) { + throw new Error('Not all certificates were returned: ' + JSON.stringify(expected, null, ' ')); + } + next(); + }); + } + }); + } + + series([ + importSomeCertificates, + listCertificate, + function () { + done(); + } + ]); + + }); + }); + + describe('list versions', function () { + it('should work', function (done) { + var CERTIFICATE_NAME = 'importListVersionCerts'; + this.timeout(100000); + var expected = {}; + + function importSameCertificates(next) { + importCommonCertificate(CERTIFICATE_NAME, function (err, certificateBundle) { + if (err) throw err; + expected[certificateBundle.id] = certificateBundle.attributes; + + importCommonCertificate(CERTIFICATE_NAME, function (err, certificateBundle) { + if (err) throw err; + expected[certificateBundle.id] = certificateBundle.attributes; + next(); + }); + }); + } + + function listCertificateVersions(next) { + client.getCertificateVersions(vaultUri, CERTIFICATE_NAME, { maxresults: LIST_TEST_SIZE }, function (err, certVersionList) { + if (err) throw err; + should(certVersionList.length).be.within(0, LIST_TEST_SIZE); + validateCertificateList(certVersionList, expected); + if (certVersionList.nextLink) { + return getNextCertificateVersions(certVersionList.nextLink); + } + + if (expected.length && expected.length !== 0) { + throw new Error('Not all certificates versions were returned: ' + JSON.stringify(expected, null, ' ')); + } + next(); + + function getNextCertificateVersions(nextLink) { + client.getCertificateVersionsNext(nextLink, function (err, list) { + if (err) throw err; + validateCertificateList(list, expected); + if (list.nextLink) { + return getNextCertificateVersions(list.nextLink); + } + if (expected.length && expected.length !== 0) { + throw new Error('Not all certificates versions were returned: ' + JSON.stringify(expected, null, ' ')); + } + next(); + }); + } + }); + } + + series([ + importSameCertificates, + listCertificateVersions, + function () { + done(); + } + ]); + }); + }); + + describe('CRUD issuer', function () { + it('should work', function (done) { + + this.timeout(100000); + setTimeout(done, 100000); + + var ISSUER_NAME = 'nodeIssuer'; + + var issuerBundle = { + provider: 'test', + credentials: { + accountId: 'keyvaultuser', + password: 'password' + }, + organizationDetails: { + adminDetails: [{ + firstName: 'Jane', + lastName: 'Doe', + emailAddress: 'admin@contoso.com', + phone: '4256666666' + }] + } + }; + + function createCertificateIssuer(next) { + client.setCertificateIssuer(vaultUri, ISSUER_NAME, issuerBundle, function (err, responseIssuerBundle) { + if (err) throw err; + validateIssuerBundle(responseIssuerBundle, vaultUri, ISSUER_NAME, issuerBundle); + next(); + }); + } + + function getCertificateIssuer(next) { + client.getCertificateIssuer(vaultUri, ISSUER_NAME, function (err, responseIssuerBundle) { + if (err) throw err; + validateIssuerBundle(responseIssuerBundle, vaultUri, ISSUER_NAME, issuerBundle); + next(); + }); + } + + function updateCertificateIssuer(next) { + var updateIssuer = { + provider: 'test', + credentials: { + accountId: 'xboxuser', + password: 'security' + }, + organizationDetails: { + adminDetails: [{ + firstName: 'Jane II', + lastName: 'Doe', + emailAddress: 'admin@contoso2.com', + phone: '1111111111' + }] + } + }; + client.updateCertificateIssuer(vaultUri, ISSUER_NAME, updateIssuer, function (err, responseIssuerBundle) { + if (err) throw err; + validateIssuerBundle(responseIssuerBundle, vaultUri, ISSUER_NAME, updateIssuer); + next(); + }); + } + + function deleteCertificateIssuer(next) { + client.deleteCertificateIssuer(vaultUri, ISSUER_NAME, function (err, responseIssuerBundle) { + if (err) throw err; + next(); + }); + } + + function getNoneExistingIssuer(next) { + client.getCertificateIssuer(vaultUri, ISSUER_NAME, function (err, responseIssuerBundle) { + if (!err || !err.code || err.code !== 'CertificateIssuerNotFound' || !err.statusCode || err.statusCode !== 404) { + throw new Error('Unexpected error object: ' + JSON.stringify(err, null, ' ')); + } + next(); + }); + } + + series([ + createCertificateIssuer, + getCertificateIssuer, + updateCertificateIssuer, + deleteCertificateIssuer, + getNoneExistingIssuer, + function () { done(); } + ]); + + }); + }); + + describe('list issuers', function () { + it('should work', function (done) { + + this.timeout(10000); + + var expected = {}; + + function setCertificateIssuers(next) { + + var issuerBundle = { + provider: 'test', + credentials: { + accountId: 'keyvaultuser', + password: 'password' + }, + organizationDetails: { + adminDetails: [{ + firstName: 'Jane', + lastName: 'Doe', + emailAddress: 'admin@contoso.com', + phone: '4256666666' + }] + } + }; + + client.setCertificateIssuer(vaultUri, 'nodeIssuer1', issuerBundle, function (err, setIssuerBundle) { + if (err) throw err; + expected[setIssuerBundle.id] = setIssuerBundle.provider; + + client.setCertificateIssuer(vaultUri, 'nodeIssuer2', issuerBundle, function (err, setIssuerBundle) { + if (err) throw err; + expected[setIssuerBundle.id] = setIssuerBundle.provider; + next(); + }); + }); + } + + function listCertificateIssuers(next) { + + client.getCertificateIssuers(vaultUri, { maxresults: LIST_TEST_SIZE }, function (err, issuerList1) { + if (err) throw err; + validateCertificateIssuerList(issuerList1, expected); + should(issuerList1.length).be.within(0, LIST_TEST_SIZE); + + if (issuerList1.nextLink) { + return getNextIssuers(issuerList1.nextLink); + } + + if (expected.length && expected.length !== 0) { + throw new Error('Not all issuers were returned: ' + JSON.stringify(expected, null, ' ')); + } + next(); + + function getNextIssuers(nextList) { + client.getCertificateIssuersNext(nextList, function (err, issuerList) { + if (err) throw err; + validateCertificateIssuerList(issuerList, expected); + if (issuerList.nextLink) { + return getNextIssuers(issuerList.nextLink); + } + if (expected.length && expected.length !== 0) { + throw new Error('Not all issuers were returned: ' + JSON.stringify(expected, null, ' ')); + } + next(); + }); + } + }); + } + + series([ + setCertificateIssuers, + listCertificateIssuers, + function () { done(); } + ]); + + }); + }); + + describe('async request cancellation and deletion', function () { + it('should work', function (done) { + + this.timeout(10000); + + var certificateName = "asyncCancelledDeletedCert"; + var certificatePolicy = { + keyProperties: { + exportable: true, + reuseKey: false, + keySize: 2048, + keyType: 'RSA' + }, + secretProperties: { + contentType: 'application/x-pkcs12' + }, + issuerReference: { + name: 'Self' + }, + x509CertificateProperties: { + subject: 'CN=*.microsoft.com', + subjectAlternativeNames: ["onedrive.microsoft.com", "xbox.microsoft.com"] + }, + ValidityInMonths: 24, + }; + + function createCertificate(next) { + + client.createCertificate(vaultUri, certificateName, { certificatePolicy: certificatePolicy }, function (err, certificateOperation) { + if (err) throw err; + next(); + }); + } + + function cancelCertificateOperation(next) { + + var certificateOperation = { + cancellationRequested: true + }; + client.updateCertificateOperation(vaultUri, certificateName, certificateOperation, function (err, cancelledCertificateOperation) { + if (err) throw err; + should.exist(cancelledCertificateOperation.cancellationRequested); + should(cancelledCertificateOperation.cancellationRequested).be.exactly(true); + validateCertificateOperation(cancelledCertificateOperation, vaultUri, certificateName, certificatePolicy); + + client.getCertificateOperation(vaultUri, certificateName, function (err, retrievedCertificateOperation) { + if (err) throw err; + + should.exist(cancelledCertificateOperation.cancellationRequested); + should(cancelledCertificateOperation.cancellationRequested).be.exactly(true); + validateCertificateOperation(retrievedCertificateOperation, vaultUri, certificateName, certificatePolicy); + next(); + }); + }); + } + + function deleteCertificateOperation(next) { + + client.deleteCertificateOperation(vaultUri, certificateName, function (err, deletedCertificateOperation) { + if (err) throw err; + should.exist(deletedCertificateOperation); + validateCertificateOperation(deletedCertificateOperation, vaultUri, certificateName, certificatePolicy); + + client.getCertificateOperation(vaultUri, certificateName, function (err, retrievedCertificateOperation) { + if (!err || !err.code || err.code !== 'PendingCertificateNotFound' || !err.statusCode || err.statusCode !== 404) { + throw new Error('Unexpected error object: ' + JSON.stringify(err, null, ' ')); + } + next(); + }); + }); + } + + function deleteCancelledCertificateOperation(next) { + client.deleteCertificate(vaultUri, certificateName, function (err, certificateBundle) { + if (err) throw err; + next(); + }); + } + + series([ + createCertificate, + cancelCertificateOperation, + deleteCertificateOperation, + deleteCancelledCertificateOperation, + function () { done(); } + ]); + + }); + }); + + describe('CRUD contacts', function () { + it('should work', function (done) { + + var contacts = { + contactList: [{ + emailAddress: 'admin@contoso.com', + name: 'John Doe', + phone: '1111111111' + }, { + emailAddress: 'admin2@contoso.com', + name: 'John Doe2', + phone: '2222222222' + }] + }; + + function createCertificateContacts(next) { + client.setCertificateContacts(vaultUri, contacts, function (err, responseContacts) { + if (err) throw err; + validateCertificateContacts(responseContacts, vaultUri, contacts); + next(); + }); + } + + function getCertificateContacts(next) { + client.getCertificateContacts(vaultUri, function (err, responseContacts) { + if (err) throw err; + validateCertificateContacts(responseContacts, vaultUri, contacts); + next(); + }); + } + + function deleteCertificateContacts(next) { + client.deleteCertificateContacts(vaultUri, function (err, responseContacts) { + if (err) throw err; + validateCertificateContacts(responseContacts, vaultUri, contacts); + next(); + }); + } + + function getNoneExistingContacts(next) { + client.getCertificateContacts(vaultUri, function (err, responseContacts) { + if (!err || !err.code || err.code !== 'ContactsNotFound' || !err.statusCode || err.statusCode !== 404) { + throw new Error('Unexpected error object: ' + JSON.stringify(err, null, ' ')); + } + next(); + }); + } + + series([ + createCertificateContacts, + getCertificateContacts, + deleteCertificateContacts, + getNoneExistingContacts, + function () { done(); } + ]); + + }); + }); + + describe('policy', function () { + it('should work', function (done) { + + this.timeout(10000); + + var certificateName = 'policyCertificate'; + + function getCertificatePolicy(next) { + + importCommonCertificate(certificateName, function (err, certificateBundle, certificatePolicy) { + if (err) throw err; + client.getCertificatePolicy(vaultUri, certificateName, function (err, retrievedCertificatePolicy) { + if (err) throw err; + should.exist(retrievedCertificatePolicy); + next(); + }); + }); + + } + + function updateCertificatePolicy(next) { + + var certificatePolicy = { + keyProperties: { + exportable: true, + reuseKey: false, + keySize: 2048, + keyType: 'RSA' + }, + secretProperties: { + contentType: 'application/x-pkcs12' + }, + issuerReference: { + name: 'Self' + } + }; + + client.updateCertificatePolicy(vaultUri, certificateName, certificatePolicy, function (err, certificateBundle, updatedCertificatePolicy) { + if (err) throw err; + client.getCertificatePolicy(vaultUri, certificateName, function (err, updatedCertificatePolicy) { + if (err) throw err; + should.exist(updatedCertificatePolicy); + next(); + }); + }); + } + + series([ + getCertificatePolicy, + updateCertificatePolicy, + function () { done(); } + ]); + + }); + }); + + describe('manual enrolled', function () { + it('should work', function (done) { + + this.timeout(10000); + + var certificateName = "UnknownIssuerCert1"; + var certificatePolicy = { + keyProperties: { + exportable: true, + reuseKey: false, + keySize: 2048, + keyType: 'RSA' + }, + secretProperties: { + contentType: 'application/x-pkcs12' + }, + issuerReference: { + name: 'Unknown' + }, + x509CertificateProperties: { + subject: 'CN=*.microsoft.com', + subjectAlternativeNames: ["onedrive.microsoft.com", "xbox.microsoft.com"] + } + }; + + function getPendingCertificateSigningRequest(next) { + + client.createCertificate(vaultUri, certificateName, { certificatePolicy: certificatePolicy }, function (err, certificateOperation) { + if (err) throw err; + + try { + client.getPendingCertificateSigningRequest(vaultUri, certificateName, function (err, pendingVersionCsr) { + if (err) throw err; + should(new Buffer(certificateOperation.csr).toString('base64')).be.exactly(pendingVersionCsr); + next(); + }); + } + catch (e) { throw e; } + finally { + client.deleteCertificate(vaultUri, certificateName, function (err, certificateBundle) { + if (err) throw err; + next(); + }); + } + }); + } + + series([ + getPendingCertificateSigningRequest, + function () { done(); } + ]); + + }); + }); + + function importCommonCertificate(certificateName, callback) { + var certificateContent = "MIIJOwIBAzCCCPcGCSqGSIb3DQEHAaCCCOgEggjkMIII4DCCBgkGCSqGSIb3DQEHAaCCBfoEggX2MIIF8jCCBe4GCyqGSIb3DQEMCgECoIIE/jCCBPowHAYKKoZIhvcNAQwBAzAOBAj15YH9pOE58AICB9AEggTYLrI+SAru2dBZRQRlJY7XQ3LeLkah2FcRR3dATDshZ2h0IA2oBrkQIdsLyAAWZ32qYR1qkWxLHn9AqXgu27AEbOk35+pITZaiy63YYBkkpR+pDdngZt19Z0PWrGwHEq5z6BHS2GLyyN8SSOCbdzCz7blj3+7IZYoMj4WOPgOm/tQ6U44SFWek46QwN2zeA4i97v7ftNNns27ms52jqfhOvTA9c/wyfZKAY4aKJfYYUmycKjnnRl012ldS2lOkASFt+lu4QCa72IY6ePtRudPCvmzRv2pkLYS6z3cI7omT8nHP3DymNOqLbFqr5O2M1ZYaLC63Q3xt3eVvbcPh3N08D1hHkhz/KDTvkRAQpvrW8ISKmgDdmzN55Pe55xHfSWGB7gPw8sZea57IxFzWHTK2yvTslooWoosmGxanYY2IG/no3EbPOWDKjPZ4ilYJe5JJ2immlxPz+2e2EOCKpDI+7fzQcRz3PTd3BK+budZ8aXX8aW/lOgKS8WmxZoKnOJBNWeTNWQFugmktXfdPHAdxMhjUXqeGQd8wTvZ4EzQNNafovwkI7IV/ZYoa++RGofVR3ZbRSiBNF6TDj/qXFt0wN/CQnsGAmQAGNiN+D4mY7i25dtTu/Jc7OxLdhAUFpHyJpyrYWLfvOiS5WYBeEDHkiPUa/8eZSPA3MXWZR1RiuDvuNqMjct1SSwdXADTtF68l/US1ksU657+XSC+6ly1A/upz+X71+C4Ho6W0751j5ZMT6xKjGh5pee7MVuduxIzXjWIy3YSd0fIT3U0A5NLEvJ9rfkx6JiHjRLx6V1tqsrtT6BsGtmCQR1UCJPLqsKVDvAINx3cPA/CGqr5OX2BGZlAihGmN6n7gv8w4O0k0LPTAe5YefgXN3m9pE867N31GtHVZaJ/UVgDNYS2jused4rw76ZWN41akx2QN0JSeMJqHXqVz6AKfz8ICS/dFnEGyBNpXiMRxrY/QPKi/wONwqsbDxRW7vZRVKs78pBkE0ksaShlZk5GkeayDWC/7Hi/NqUFtIloK9XB3paLxo1DGu5qqaF34jZdktzkXp0uZqpp+FfKZaiovMjt8F7yHCPk+LYpRsU2Cyc9DVoDA6rIgf+uEP4jppgehsxyT0lJHax2t869R2jYdsXwYUXjgwHIV0voj7bJYPGFlFjXOp6ZW86scsHM5xfsGQoK2Fp838VT34SHE1ZXU/puM7rviREHYW72pfpgGZUILQMohuTPnd8tFtAkbrmjLDo+k9xx7HUvgoFTiNNWuq/cRjr70FKNguMMTIrid+HwfmbRoaxENWdLcOTNeascER2a+37UQolKD5ksrPJG6RdNA7O2pzp3micDYRs/+s28cCIxO//J/d4nsgHp6RTuCu4+Jm9k0YTw2Xg75b2cWKrxGnDUgyIlvNPaZTB5QbMid4x44/lE0LLi9kcPQhRgrK07OnnrMgZvVGjt1CLGhKUv7KFc3xV1r1rwKkosxnoG99oCoTQtregcX5rIMjHgkc1IdflGJkZzaWMkYVFOJ4Weynz008i4ddkske5vabZs37Lb8iggUYNBYZyGzalruBgnQyK4fz38Fae4nWYjyildVfgyo/fCePR2ovOfphx9OQJi+M9BoFmPrAg+8ARDZ+R+5yzYuEc9ZoVX7nkp7LTGB3DANBgkrBgEEAYI3EQIxADATBgkqhkiG9w0BCRUxBgQEAQAAADBXBgkqhkiG9w0BCRQxSh5IAGEAOAAwAGQAZgBmADgANgAtAGUAOQA2AGUALQA0ADIAMgA0AC0AYQBhADEAMQAtAGIAZAAxADkANABkADUAYQA2AGIANwA3MF0GCSsGAQQBgjcRATFQHk4ATQBpAGMAcgBvAHMAbwBmAHQAIABTAHQAcgBvAG4AZwAgAEMAcgB5AHAAdABvAGcAcgBhAHAAaABpAGMAIABQAHIAbwB2AGkAZABlAHIwggLPBgkqhkiG9w0BBwagggLAMIICvAIBADCCArUGCSqGSIb3DQEHATAcBgoqhkiG9w0BDAEGMA4ECNX+VL2MxzzWAgIH0ICCAojmRBO+CPfVNUO0s+BVuwhOzikAGNBmQHNChmJ/pyzPbMUbx7tO63eIVSc67iERda2WCEmVwPigaVQkPaumsfp8+L6iV/BMf5RKlyRXcwh0vUdu2Qa7qadD+gFQ2kngf4Dk6vYo2/2HxayuIf6jpwe8vql4ca3ZtWXfuRix2fwgltM0bMz1g59d7x/glTfNqxNlsty0A/rWrPJjNbOPRU2XykLuc3AtlTtYsQ32Zsmu67A7UNBw6tVtkEXlFDqhavEhUEO3dvYqMY+QLxzpZhA0q44ZZ9/ex0X6QAFNK5wuWxCbupHWsgxRwKftrxyszMHsAvNoNcTlqcctee+ecNwTJQa1/MDbnhO6/qHA7cfG1qYDq8Th635vGNMW1w3sVS7l0uEvdayAsBHWTcOC2tlMa5bfHrhY8OEIqj5bN5H9RdFy8G/W239tjDu1OYjBDydiBqzBn8HG1DSj1Pjc0kd/82d4ZU0308KFTC3yGcRad0GnEH0Oi3iEJ9HbriUbfVMbXNHOF+MktWiDVqzndGMKmuJSdfTBKvGFvejAWVO5E4mgLvoaMmbchc3BO7sLeraHnJN5hvMBaLcQI38N86mUfTR8AP6AJ9c2k514KaDLclm4z6J8dMz60nUeo5D3YD09G6BavFHxSvJ8MF0Lu5zOFzEePDRFm9mH8W0N/sFlIaYfD/GWU/w44mQucjaBk95YtqOGRIj58tGDWr8iUdHwaYKGqU24zGeRae9DhFXPzZshV1ZGsBQFRaoYkyLAwdJWIXTi+c37YaC8FRSEnnNmS79Dou1Kc3BvK4EYKAD2KxjtUebrV174gD0Q+9YuJ0GXOTspBvCFd5VT2Rw5zDNrA/J3F5fMCk4wOzAfMAcGBSsOAwIaBBSxgh2xyF+88V4vAffBmZXv8Txt4AQU4O/NX4MjxSodbE7ApNAMIvrtREwCAgfQ"; + var certificatePassword = "123"; + var certificatePolicy = { + keyProperties: { + exportable: true, + reuseKey: false, + keySize: 2048, + keyType: 'RSA' + }, + secretProperties: { + contentType: 'application/x-pkcs12' + } + }; + + client.importCertificate(vaultUri, certificateName, certificateContent, { password: certificatePassword, certificatePolicy: certificatePolicy }, function (err, bundle) { + callback(err, bundle, certificatePolicy); + }); + } + + function cleanupCreatedCertificates(callback) { + if (!suiteUtil.isMocked) { + client.getCertificates(vaultUri, function (err, list) { + if (list && list.length !== 0) { + list.forEach(function (cert) { + var id = KeyVault.parseCertificateIdentifier(cert.id); + client.deleteCertificate(id.vault, id.name, function (err, bundle) { }); + }); + } + callback();; + }); + } + else callback(); + } + +}); \ No newline at end of file diff --git a/test/services/keyVault/keyVault-key-tests.js b/test/services/keyVault/keyVault-key-tests.js index ed84146aa..69ee8749f 100644 --- a/test/services/keyVault/keyVault-key-tests.js +++ b/test/services/keyVault/keyVault-key-tests.js @@ -22,6 +22,7 @@ var MockedTestUtils = require('../../framework/mocked-test-utils'); var KvUtils = require('./kv-test-utils.js'); var Crypto = require('crypto'); var util = require('util'); +var should = require('should'); var series = KvUtils.series; var assertExactly = KvUtils.assertExactly; @@ -34,7 +35,7 @@ var random = KvUtils.getRandom(); var vaultUri = process.env['AZURE_KV_VAULT']; if (!vaultUri) { - vaultUri = 'https://nodesdktest.vault.azure.net'; + vaultUri = 'https://sdktestvault0511.vault.azure.net'; } var standardVaultOnly = process.env['AZURE_KV_STANDARD_VAULT_ONLY']; @@ -43,7 +44,7 @@ if (!standardVaultOnly || standardVaultOnly.toLowerCase() == 'false') { } var KEY_NAME = 'nodeKey'; -var LIST_TEST_SIZE = 5; +var LIST_TEST_SIZE = 2; describe('Key Vault keys', function () { @@ -59,7 +60,9 @@ describe('Key Vault keys', function () { }); after(function (done) { - suiteUtil.teardownSuite(done); + cleanupCreatedKeys(function () { + suiteUtil.teardownSuite(done); + }); }); beforeEach(function (done) { @@ -70,9 +73,9 @@ describe('Key Vault keys', function () { suiteUtil.baseTeardownTest(done); }); - describe('identifier', function() { - it('should work', function(done) { - + describe('identifier', function () { + it('should work', function (done) { + function assertMatch(vault, name, version, keyId) { assertExactly(util.format('%s/keys/%s', vault, name), keyId.baseIdentifier); if (version) { @@ -84,7 +87,7 @@ describe('Key Vault keys', function () { assertExactly(name, keyId.name); assertExactly(version, keyId.version); } - + function verifyCreate(vault, name, version) { var keyId, parsedId; if (version) { @@ -103,20 +106,22 @@ describe('Key Vault keys', function () { verifyCreate(vaultUri, KEY_NAME, null); verifyCreate(vaultUri, KEY_NAME, '1234'); - + done(); - + }); }); - + describe('CRUD operations', function () { it('should work', function (done) { - + + this.timeout(10000); + var createdBundle; var keyId; function createKey(next) { - client.createKey(vaultUri, KEY_NAME, { kty: 'RSA' }, function(err, keyBundle) { + client.createKey(vaultUri, KEY_NAME, 'RSA', function (err, keyBundle) { if (err) throw err; validateRsaKeyBundle(keyBundle, vaultUri, KEY_NAME, 'RSA'); createdBundle = keyBundle; @@ -124,9 +129,9 @@ describe('Key Vault keys', function () { next(); }); } - + function getKeyWOVersion(next) { - client.getKey(keyId.baseIdentifier, function(err, keyBundle) { + client.getKey(keyId.baseIdentifier, function (err, keyBundle) { if (err) throw err; compareObjects(createdBundle, keyBundle); next(); @@ -134,7 +139,7 @@ describe('Key Vault keys', function () { } function getKeyWithVersion(next) { - client.getKey(keyId.identifier, function(err, keyBundle) { + client.getKey(keyId.identifier, function (err, keyBundle) { if (err) throw err; compareObjects(createdBundle, keyBundle); next(); @@ -143,11 +148,11 @@ describe('Key Vault keys', function () { function updateKey(keyUri, next) { var updatingBundle = KvUtils.clone(createdBundle); - updatingBundle.attributes.exp = new Date('2050-02-02T08:00:00.000Z'); - updatingBundle.key.key_ops = ['encrypt', 'decrypt']; + updatingBundle.attributes.expires = new Date('2050-02-02T08:00:00.000Z'); + updatingBundle.key.keyOps = ['encrypt', 'decrypt']; updatingBundle.tags = { foo: random.hex(100) }; - var request = { key_ops: updatingBundle.key.key_ops, attributes: updatingBundle.attributes, tags: updatingBundle.tags }; - client.updateKey(keyUri, request, function(err, keyBundle) { + var request = { keyOps: updatingBundle.key.keyOps, keyAttributes: updatingBundle.attributes, tags: updatingBundle.tags }; + client.updateKey(keyUri, request, function (err, keyBundle) { if (err) throw err; updatingBundle.attributes.updated = keyBundle.attributes.updated; compareObjects(updatingBundle, keyBundle); @@ -155,17 +160,17 @@ describe('Key Vault keys', function () { next(); }); } - + function updateKeyWOVersion(next) { return updateKey(keyId.baseIdentifier, next); } - + function updateKeyWithVersion(next) { return updateKey(keyId.identifier, next); } function deleteKey(next) { - client.deleteKey(keyId.vault, keyId.name, function(err, keyBundle) { + client.deleteKey(keyId.vault, keyId.name, function (err, keyBundle) { if (err) throw err; compareObjects(createdBundle, keyBundle); next(); @@ -173,7 +178,7 @@ describe('Key Vault keys', function () { } function getKeyReturnsNotFound(next) { - client.getKey(keyId.baseIdentifier, function(err, keyBundle) { + client.getKey(keyId.baseIdentifier, function (err, keyBundle) { if (!err || !err.code || err.code !== 'KeyNotFound' || !err.statusCode || err.statusCode !== 404) { throw new Error('Unexpected error object: ' + JSON.stringify(err, null, ' ')); } @@ -189,37 +194,38 @@ describe('Key Vault keys', function () { updateKeyWithVersion, deleteKey, getKeyReturnsNotFound, - function () {done();} - ]); - + function () { done(); } + ]); + }); }); - - describe('import', function() { - it('should work', function(done) { - + + + describe('import', function () { + it('should work', function (done) { + + this.timeout(10000); + function doImport(importToHardware, next) { - var importKeyRequest = { - key: { - kty: 'RSA', - key_ops: ['encrypt', 'decrypt', 'sign', 'verify', 'wrapKey', 'unwrapKey'] - }, - hsm: importToHardware - }; - setRsaParameters(importKeyRequest.key, getTestKey(suiteUtil)); - client.importKey(vaultUri, KEY_NAME, importKeyRequest, function(err, keyBundle) { + var key = { + kty: 'RSA', + keyOps: ['encrypt', 'decrypt', 'sign', 'verify', 'wrapKey', 'unwrapKey'] + }; + + setRsaParameters(key, getTestKey(suiteUtil)); + client.importKey(vaultUri, KEY_NAME, key, { hsm: importToHardware }, function (err, keyBundle) { if (err) throw err; - validateRsaKeyBundle(keyBundle, vaultUri, KEY_NAME, importToHardware ? 'RSA-HSM' : 'RSA', importKeyRequest.key_ops); + validateRsaKeyBundle(keyBundle, vaultUri, KEY_NAME, importToHardware ? 'RSA-HSM' : 'RSA', key.keyOps); next(); }); }; - + function importToSoftware(next) { - doImport(false, next); + doImport(false, next); } - + function importToHardware(next) { - if(!standardVaultOnly) { + if (!standardVaultOnly) { doImport(true, next); } else { doImport(false, next); @@ -229,15 +235,16 @@ describe('Key Vault keys', function () { series([ importToSoftware, importToHardware, - function() {done();} - ]); + function () { done(); } + ]); }); }); - - // TODO: Disabled because intermittently fails due to throtlling. We need to have a better back-off handling here. - describe.skip('list', function() { - it('should work', function(done) { + + describe('list', function () { + it('should work', function (done) { + + this.timeout(100000); var maxKeys = LIST_TEST_SIZE; var expected = {}; @@ -249,7 +256,7 @@ describe('Key Vault keys', function () { var errorCount = 0; function createAKey() { - client.createKey(vaultUri, KEY_NAME + (keyCount+1), { kty: 'RSA' }, function(err, keyBundle) { + client.createKey(vaultUri, KEY_NAME + (keyCount + 1), 'RSA', function (err, keyBundle) { if (err && err.code == 'Throttled') { ++errorCount; return setTimeout(createAKey, errorCount * 2500); @@ -271,72 +278,48 @@ describe('Key Vault keys', function () { function listKeys(next) { var currentResult; - client.getKeys(vaultUri, null, function(err, result) { + client.getKeys(vaultUri, { maxresults: LIST_TEST_SIZE }, function (err, result) { if (err) throw err; - //console.log('getKeys: ' + JSON.stringify(result, null, ' ')); + should(result.length).be.within(0, LIST_TEST_SIZE); validateKeyList(result, expected); currentResult = result; if (currentResult.nextLink) { - return getNextKeys(); + return getNextKeys(currentResult.nextLink); } next(); - - function getNextKeys() { - client.getKeysNext(currentResult.nextLink, function(err, result) { + + function getNextKeys(nextLink) { + client.getKeysNext(nextLink, function (err, list) { if (err) throw err; - validateKeyList(result, expected); - currentResult = result; - if (currentResult.nextLink) { - return getNextKeys(); + validateKeyList(list, expected); + if (list.nextLink) { + return getNextKeys(list.nextLink); } - if (Object.keys(expected).length !== zeroCount) { - throw new Error('Not all keys were returned: ' + JSON.stringify(Object.keys(expected), null, ' ')); + if (expected.length && expected.length !== 0) { + throw new Error('Not all keys were returned: ' + JSON.stringify(expected, null, ' ')); } next(); }); } - + }); } - function deleteKeys(next) { - - var keyNum = 1; - - function deleteAKey() { - client.deleteKey(vaultUri, KEY_NAME+keyNum, function(err, keyBundle) { - if (err) { - console.info('Unable to delete key: ' + JSON.stringify(err)); - } - ++keyNum; - if (keyNum <= maxKeys) { - return deleteAKey(); - } - next(); - }); - } - - deleteAKey(); - } - series([ createManyKeys, listKeys, - deleteKeys, - function() { - if (!suiteUtil.isMocked) { - // Avoid being throttled in the next test. - setTimeout(function() {done();}, 5000); - } + function () { + done(); } ]); }); }); - // TODO: Disabled because intermittently fails due to throtlling. We need to have a better back-off handling here. - describe.skip('list versions', function() { - it('should work', function(done) { + describe('list versions', function () { + it('should work', function (done) { + + this.timeout(10000); var maxKeys = LIST_TEST_SIZE; var expected = {}; @@ -348,7 +331,7 @@ describe('Key Vault keys', function () { var errorCount = 0; function createAKey() { - client.createKey(vaultUri, KEY_NAME, { kty: 'RSA' }, function(err, keyBundle) { + client.createKey(vaultUri, KEY_NAME, 'RSA', function (err, keyBundle) { if (err && err.code == 'Throttled') { ++errorCount; return setTimeout(createAKey, errorCount * 2500); @@ -369,59 +352,47 @@ describe('Key Vault keys', function () { function listKeyVersions(next) { var currentResult; - client.getKeyVersions(vaultUri, KEY_NAME, null, function(err, result) { + client.getKeyVersions(vaultUri, KEY_NAME, function (err, result) { if (err) throw err; validateKeyList(result, expected); currentResult = result; if (currentResult.nextLink) { - return getNextKeys(); + return getNextKeys(currentResult.nextLink); } next(); - - function getNextKeys() { - client.getKeyVersionsNext(currentResult.nextLink, function(err, result) { + + function getNextKeys(nextLink) { + client.getKeyVersionsNext(currentResult.nextLink, function (err, list) { if (err) throw err; - validateKeyList(result, expected); - currentResult = result; - if (currentResult.nextLink) { - return getNextKeys(); + validateKeyList(list, expected); + if (list.nextLink) { + return getNextKeys(list.nextLink); } - if (Object.keys(expected).length !== zeroCount) { - throw new Error('Not all keys were returned: ' + JSON.stringify(Object.keys(expected), null, ' ')); + if (expected.length && expected.length !== 0) { + throw new Error('Not all key versions were returned: ' + JSON.stringify(expected, null, ' ')); } next(); }); } - - }); - } - function deleteKey(next) { - client.deleteKey(vaultUri, KEY_NAME, function(err, keyBundle) { - if (err) { - console.info('Unable to delete key: ' + JSON.stringify(err)); - } - next(); }); } series([ createManyKeyVersions, listKeyVersions, - deleteKey, - function() { - if (!suiteUtil.isMocked) { - // Avoid being throttled in the next test. - setTimeout(function() {done();}, 5000); - } + function () { + done(); } ]); }); }); - describe('backup and restore', function() { - it('should work', function(done) { + describe('backup and restore', function () { + it('should work', function (done) { + + this.timeout(10000); var keyName = KEY_NAME + 'forBkp'; var createdBundle; @@ -429,7 +400,7 @@ describe('Key Vault keys', function () { var keyBackup; function createKey(next) { - client.createKey(vaultUri, keyName, { kty: 'RSA' }, function(err, keyBundle) { + client.createKey(vaultUri, keyName, 'RSA', function (err, keyBundle) { if (err) throw err; createdBundle = keyBundle; keyId = KeyVault.parseKeyIdentifier(createdBundle.key.kid); @@ -438,7 +409,7 @@ describe('Key Vault keys', function () { } function backup(next) { - client.backupKey(keyId.vault, keyId.name, function(err, result) { + client.backupKey(keyId.vault, keyId.name, function (err, result) { if (err) throw err; keyBackup = result.value; next(); @@ -446,14 +417,14 @@ describe('Key Vault keys', function () { } function deleteKey(next) { - client.deleteKey(keyId.vault, keyId.name, function(err, keyBundle) { + client.deleteKey(keyId.vault, keyId.name, function (err, keyBundle) { if (err) throw err; next(); }); } function restore(next) { - client.restoreKey(vaultUri, keyBackup, function(err, keyBundle) { + client.restoreKey(vaultUri, keyBackup, function (err, keyBundle) { if (err) throw err; compareObjects(createdBundle, keyBundle); next(); @@ -465,21 +436,23 @@ describe('Key Vault keys', function () { backup, deleteKey, restore, - function() {done();} + function () { done(); } ]); }); }); - describe('encrypt and decrypt', function() { - it ('should work', function(done) { + describe('encrypt and decrypt', function () { + it('should work', function (done) { + + this.timeout(10000); var keyId = KeyVault.createKeyIdentifier(vaultUri, KEY_NAME); var plainText = new Buffer(random.hex(200), 'hex'); var cipherText; function importKey(next) { - importTestKey(client, keyId, function(err, keyBundle) { + importTestKey(client, keyId, function (err, keyBundle) { if (err) throw err; keyId = KeyVault.parseKeyIdentifier(keyBundle.key.kid); next(); @@ -487,33 +460,33 @@ describe('Key Vault keys', function () { } function encryptWOVersion(next) { - client.encrypt(keyId.baseIdentifier, 'RSA-OAEP', plainText, function(err, result) { + client.encrypt(keyId.baseIdentifier, 'RSA-OAEP', plainText, function (err, result) { if (err) throw err; - cipherText = result.value; + cipherText = result.result; next(); }); } function decryptWOVersion(next) { - client.decrypt(keyId.baseIdentifier, 'RSA-OAEP', cipherText, function(err, result) { + client.decrypt(keyId.baseIdentifier, 'RSA-OAEP', cipherText, function (err, result) { if (err) throw err; - compareObjects(plainText, result.value); + compareObjects(plainText, result.result); next(); }); } function encryptWithVersion(next) { - client.encrypt(keyId.identifier, 'RSA-OAEP', plainText, function(err, result) { + client.encrypt(keyId.identifier, 'RSA-OAEP', plainText, function (err, result) { if (err) throw err; - cipherText = result.value; + cipherText = result.result; next(); }); } function decryptWithVersion(next) { - client.decrypt(keyId.identifier, 'RSA-OAEP', cipherText, function(err, result) { + client.decrypt(keyId.identifier, 'RSA-OAEP', cipherText, function (err, result) { if (err) throw err; - compareObjects(plainText, result.value); + compareObjects(plainText, result.result); next(); }); } @@ -524,21 +497,23 @@ describe('Key Vault keys', function () { decryptWOVersion, encryptWithVersion, decryptWithVersion, - function() {done();} + function () { done(); } ]); }); }); - describe('wrap and unwrap', function() { - it ('should work', function(done) { + describe('wrap and unwrap', function () { + it('should work', function (done) { + + this.timeout(10000); var keyId = KeyVault.createKeyIdentifier(vaultUri, KEY_NAME); var plainText = new Buffer(random.hex(200), 'hex'); var cipherText; function importKey(next) { - importTestKey(client, keyId, function(err, keyBundle) { + importTestKey(client, keyId, function (err, keyBundle) { if (err) throw err; keyId = KeyVault.parseKeyIdentifier(keyBundle.key.kid); next(); @@ -546,33 +521,33 @@ describe('Key Vault keys', function () { } function wrapWOVersion(next) { - client.wrapKey(keyId.baseIdentifier, 'RSA-OAEP', plainText, function(err, result) { + client.wrapKey(keyId.baseIdentifier, 'RSA-OAEP', plainText, function (err, result) { if (err) throw err; - cipherText = result.value; + cipherText = result.result; next(); }); } function unwrapWOVersion(next) { - client.unwrapKey(keyId.baseIdentifier, 'RSA-OAEP', cipherText, function(err, result) { + client.unwrapKey(keyId.baseIdentifier, 'RSA-OAEP', cipherText, function (err, result) { if (err) throw err; - compareObjects(plainText, result.value); + compareObjects(plainText, result.result); next(); }); } function wrapWithVersion(next) { - client.wrapKey(keyId.identifier, 'RSA-OAEP', plainText, function(err, result) { + client.wrapKey(keyId.identifier, 'RSA-OAEP', plainText, function (err, result) { if (err) throw err; - cipherText = result.value; + cipherText = result.result; next(); }); } function unwrapWithVersion(next) { - client.unwrapKey(keyId.identifier, 'RSA-OAEP', cipherText, function(err, result) { + client.unwrapKey(keyId.identifier, 'RSA-OAEP', cipherText, function (err, result) { if (err) throw err; - compareObjects(plainText, result.value); + compareObjects(plainText, result.result); next(); }); } @@ -583,14 +558,16 @@ describe('Key Vault keys', function () { unwrapWOVersion, wrapWithVersion, unwrapWithVersion, - function() {done();} + function () { done(); } ]); }); }); - describe('sign and verify', function() { - it ('should work', function(done) { + describe('sign and verify', function () { + it('should work', function (done) { + + this.timeout(10000); var keyId = KeyVault.createKeyIdentifier(vaultUri, KEY_NAME); var plainText = new Buffer(random.hex(200), 'hex'); @@ -600,23 +577,23 @@ describe('Key Vault keys', function () { var signature; function importKey(next) { - importTestKey(client, keyId, function(err, keyBundle) { + importTestKey(client, keyId, function (err, keyBundle) { if (err) throw err; keyId = KeyVault.parseKeyIdentifier(keyBundle.key.kid); next(); - }) + }); } function signWOVersion(next) { - client.sign(keyId.baseIdentifier, 'RS256', digest, function(err, result) { + client.sign(keyId.baseIdentifier, 'RS256', digest, function (err, result) { if (err) throw err; - signature = result.value; + signature = result.result; next(); }); } function verifyWOVersion(next) { - client.verify(keyId.baseIdentifier, 'RS256', digest, signature, function(err, result) { + client.verify(keyId.baseIdentifier, 'RS256', digest, signature, function (err, result) { if (err) throw err; if (!result.value) { throw new Error('Expected {value:true}, but found ' + JSON.stringify(result)); @@ -626,15 +603,15 @@ describe('Key Vault keys', function () { } function signWithVersion(next) { - client.sign(keyId.identifier, 'RS256', digest, function(err, result) { + client.sign(keyId.identifier, 'RS256', digest, function (err, result) { if (err) throw err; - signature = result.value; + signature = result.result; next(); }); } function verifyWithVersion(next) { - client.verify(keyId.identifier, 'RS256', digest, signature, function(err, result) { + client.verify(keyId.identifier, 'RS256', digest, signature, function (err, result) { if (err) throw err; if (!result.value) { throw new Error('Expected {value:true}, but found ' + JSON.stringify(result)); @@ -647,21 +624,34 @@ describe('Key Vault keys', function () { importKey, signWOVersion, verifyWOVersion, - function() {done();} + function () { done(); } ]); }); }); function importTestKey(client, keyId, callback) { - var importKeyRequest = { - key: { - kty: 'RSA', - key_ops: ['encrypt', 'decrypt', 'sign', 'verify', 'wrapKey', 'unwrapKey'] - } + var key = { + kty: 'RSA', + keyOps: ['encrypt', 'decrypt', 'sign', 'verify', 'wrapKey', 'unwrapKey'] }; - setRsaParameters(importKeyRequest.key, getTestKey(suiteUtil)); - client.importKey(keyId.vault, keyId.name, importKeyRequest, callback); + setRsaParameters(key, getTestKey(suiteUtil)); + client.importKey(keyId.vault, keyId.name, key, callback); } - -}); + + function cleanupCreatedKeys(callback) { + + if (!suiteUtil.isMocked) { + client.getKeys(vaultUri, function (err, list) { + if (list && list.length !== 0) { + list.forEach(function (key) { + var id = KeyVault.parseKeyIdentifier(key.kid); + client.deleteKey(id.vault, id.name, function (err, bundle) { }); + }); + } + callback();; + }); + } + else callback(); + } +}); \ No newline at end of file diff --git a/test/services/keyVault/keyVault-secret-tests.js b/test/services/keyVault/keyVault-secret-tests.js index 236e1fef2..ebe9e7c45 100644 --- a/test/services/keyVault/keyVault-secret-tests.js +++ b/test/services/keyVault/keyVault-secret-tests.js @@ -21,6 +21,7 @@ var KeyVault = Testutil.libRequire('services/keyVault'); var MockedTestUtils = require('../../framework/mocked-test-utils'); var KvUtils = require('./kv-test-utils.js'); var util = require('util'); +var should = require('should'); var series = KvUtils.series; var assertExactly = KvUtils.assertExactly; @@ -31,12 +32,12 @@ var random = KvUtils.getRandom(); var vaultUri = process.env['AZURE_KV_VAULT']; if (!vaultUri) { - vaultUri = 'https://nodesdktest.vault.azure.net'; + vaultUri = 'https://sdktestvault0511.vault.azure.net'; } var SECRET_NAME = 'nodeSecret'; var SECRET_VALUE = 'Pa$$w0rd'; -var LIST_TEST_SIZE = 5; +var LIST_TEST_SIZE = 2; describe('Key Vault secrets', function () { @@ -46,13 +47,15 @@ describe('Key Vault secrets', function () { before(function (done) { var credentials = new KeyVault.KeyVaultCredentials(KvUtils.authenticator); client = new KeyVault.KeyVaultClient(credentials); - + suiteUtil = new MockedTestUtils(client, 'keyVault-secret-tests'); suiteUtil.setupSuite(done); }); after(function (done) { - suiteUtil.teardownSuite(done); + cleanupCreatedSecrets(function () { + suiteUtil.teardownSuite(done); + }); }); beforeEach(function (done) { @@ -62,10 +65,10 @@ describe('Key Vault secrets', function () { afterEach(function (done) { suiteUtil.baseTeardownTest(done); }); - - describe('identifier', function() { - it('should work', function(done) { - + + describe('identifier', function () { + it('should work', function (done) { + function assertMatch(vault, name, version, secretId) { assertExactly(util.format('%s/secrets/%s', vault, name), secretId.baseIdentifier); if (version) { @@ -96,20 +99,22 @@ describe('Key Vault secrets', function () { verifyCreate(vaultUri, SECRET_NAME, null); verifyCreate(vaultUri, SECRET_NAME, '1234'); - + done(); - + }); }); - + describe('CRUD operations', function () { it('should work', function (done) { - + + this.timeout(10000); + var createdBundle; var secretId; function createSecret(next) { - client.setSecret(vaultUri, SECRET_NAME, { value: SECRET_VALUE }, function(err, secretBundle) { + client.setSecret(vaultUri, SECRET_NAME, SECRET_VALUE, function (err, secretBundle) { if (err) throw err; validateSecretBundle(secretBundle, vaultUri, SECRET_NAME, SECRET_VALUE); createdBundle = secretBundle; @@ -117,9 +122,9 @@ describe('Key Vault secrets', function () { next(); }); } - + function getSecretWOVersion(next) { - client.getSecret(secretId.baseIdentifier, function(err, secretBundle) { + client.getSecret(secretId.baseIdentifier, function (err, secretBundle) { if (err) throw err; compareObjects(createdBundle, secretBundle); next(); @@ -127,7 +132,7 @@ describe('Key Vault secrets', function () { } function getSecretWithVersion(next) { - client.getSecret(secretId.identifier, function(err, secretBundle) { + client.getSecret(secretId.identifier, function (err, secretBundle) { if (err) throw err; compareObjects(createdBundle, secretBundle); next(); @@ -137,10 +142,10 @@ describe('Key Vault secrets', function () { function updateSecret(secretUri, next) { var updatingBundle = KvUtils.clone(createdBundle); updatingBundle.contentType = 'text/plain'; - updatingBundle.attributes.exp = new Date('2050-02-02T08:00:00.000Z'); + updatingBundle.attributes.expires = new Date('2050-02-02T08:00:00.000Z'); updatingBundle.tags = { foo: random.hex(100) }; - var request = { contentType: updatingBundle.contentType, attributes: updatingBundle.attributes, tags: updatingBundle.tags }; - client.updateSecret(secretUri, request, function(err, secretBundle) { + var request = { contentType: updatingBundle.contentType, secretAttributes: updatingBundle.attributes, tags: updatingBundle.tags }; + client.updateSecret(secretUri, request, function (err, secretBundle) { if (err) throw err; delete updatingBundle.value; updatingBundle.attributes.updated = secretBundle.attributes.updated; @@ -149,17 +154,17 @@ describe('Key Vault secrets', function () { next(); }); } - + function updateSecretWOVersion(next) { return updateSecret(secretId.baseIdentifier, next); } - + function updateSecretWithVersion(next) { return updateSecret(secretId.identifier, next); } function deleteSecret(next) { - client.deleteSecret(secretId.vault, secretId.name, function(err, secretBundle) { + client.deleteSecret(secretId.vault, secretId.name, function (err, secretBundle) { if (err) throw err; compareObjects(createdBundle, secretBundle); next(); @@ -167,7 +172,7 @@ describe('Key Vault secrets', function () { } function getSecretReturnsNotFound(next) { - client.getSecret(secretId.baseIdentifier, function(err, secretBundle) { + client.getSecret(secretId.baseIdentifier, function (err, secretBundle) { if (!err || !err.code || err.code !== 'SecretNotFound' || !err.statusCode || err.statusCode !== 404) throw new Error('Unexpected error object: ' + JSON.stringify(err, null, ' ')); next(); }); @@ -181,15 +186,16 @@ describe('Key Vault secrets', function () { updateSecretWithVersion, deleteSecret, getSecretReturnsNotFound, - function () {done();} - ]); - + function () { done(); } + ]); + }); }); - // TODO: Disabled because intermittently fails due to throtlling. We need to have a better back-off handling here. - describe.skip('list', function() { - it('should work', function(done) { + describe('list', function () { + it('should work', function (done) { + + this.timeout(100000); var maxSecrets = LIST_TEST_SIZE; var expected = {}; @@ -201,7 +207,7 @@ describe('Key Vault secrets', function () { var errorCount = 0; function createASecret() { - client.setSecret(vaultUri, SECRET_NAME + (secretCount+1), { value: SECRET_VALUE }, function(err, secretBundle) { + client.setSecret(vaultUri, SECRET_NAME + (secretCount + 1), SECRET_VALUE, function (err, secretBundle) { if (err && err.code == 'Throttled') { ++errorCount; return setTimeout(createASecret, errorCount * 2500); @@ -223,23 +229,22 @@ describe('Key Vault secrets', function () { function listSecrets(next) { var currentResult; - client.getSecrets(vaultUri, null, function(err, result) { + client.getSecrets(vaultUri, { maxresults: LIST_TEST_SIZE }, function (err, result) { if (err) throw err; - //console.log('getSecrets: ' + JSON.stringify(result, null, ' ')); + should(result.length).be.within(0, LIST_TEST_SIZE); validateSecretList(result, expected); currentResult = result; if (currentResult.nextLink) { - return getNextSecrets(); + return getNextSecrets(currentResult.nextLink); } next(); - - function getNextSecrets() { - client.getSecretsNext(currentResult.nextLink, function(err, result) { + + function getNextSecrets(nextLink) { + client.getSecretsNext(nextLink, function (err, list) { if (err) throw err; - validateSecretList(result, expected); - currentResult = result; - if (currentResult.nextLink) { - return getNextSecrets(); + validateSecretList(list, expected); + if (list.nextLink) { + return getNextSecrets(list.nextLink); } if (Object.keys(expected).length !== zeroCount) { throw new Error('Not all secrets were returned: ' + JSON.stringify(Object.keys(expected), null, ' ')); @@ -247,48 +252,26 @@ describe('Key Vault secrets', function () { next(); }); } - + }); } - function deleteSecrets(next) { - - var secretNum = 1; - - function deleteASecret() { - client.deleteSecret(vaultUri, SECRET_NAME+secretNum, function(err, secretBundle) { - if (err) { - console.info('Unable to delete secret: ' + JSON.stringify(err)); - } - ++secretNum; - if (secretNum <= maxSecrets) { - return deleteASecret(); - } - next(); - }); - } - - deleteASecret(); - } - series([ createManySecrets, listSecrets, - deleteSecrets, - function() { - if (!suiteUtil.isMocked) { - // Avoid being throttled in the next test. - setTimeout(function() {done();}, 5000); - } + function () { + done(); } ]); }); }); - // TODO: Disabled because intermittently fails due to throtlling. We need to have a better back-off handling here. - describe.skip('list versions', function() { - it('should work', function(done) { + describe('list versions', function () { + it('should work', function (done) { + + this.timeout(10000); + var maxSecrets = LIST_TEST_SIZE; var expected = {}; @@ -300,7 +283,7 @@ describe('Key Vault secrets', function () { var errorCount = 0; function createASecret() { - client.setSecret(vaultUri, SECRET_NAME, { value: SECRET_VALUE }, function(err, secretBundle) { + client.setSecret(vaultUri, SECRET_NAME, SECRET_VALUE, function (err, secretBundle) { if (err && err.code == 'Throttled') { ++errorCount; return setTimeout(createASecret, errorCount * 2500); @@ -321,22 +304,21 @@ describe('Key Vault secrets', function () { function listSecretVersions(next) { var currentResult; - client.getSecretVersions(vaultUri, SECRET_NAME, null, function(err, result) { + client.getSecretVersions(vaultUri, SECRET_NAME, function (err, result) { if (err) throw err; validateSecretList(result, expected); currentResult = result; if (currentResult.nextLink) { - return getNextSecrets(); + return getNextSecrets(currentResult.nextLink); } next(); - - function getNextSecrets() { - client.getSecretVersionsNext(currentResult.nextLink, function(err, result) { + + function getNextSecrets(nextList) { + client.getSecretVersionsNext(nextList, function (err, list) { if (err) throw err; - validateSecretList(result, expected); - currentResult = result; - if (currentResult.nextLink) { - return getNextSecrets(); + validateSecretList(list, expected); + if (list.nextLink) { + return getNextSecrets(list.nextLink); } if (Object.keys(expected).length !== zeroCount) { throw new Error('Not all secrets were returned: ' + JSON.stringify(Object.keys(expected), null, ' ')); @@ -344,32 +326,35 @@ describe('Key Vault secrets', function () { next(); }); } - - }); - } - function deleteSecret(next) { - client.deleteSecret(vaultUri, SECRET_NAME, function(err, secretBundle) { - if (err) { - console.info('Unable to delete secret: ' + JSON.stringify(err)); - } - next(); }); } series([ createManySecretVersions, listSecretVersions, - deleteSecret, - function() { - if (!suiteUtil.isMocked) { - // Avoid being throttled in the next test. - setTimeout(function() {done();}, 5000); - } + function () { + done(); } ]); }); }); -}); + function cleanupCreatedSecrets(callback) { + + if (!suiteUtil.isMocked) { + client.getSecrets(vaultUri, function (err, list) { + if (list && list.length !== 0) { + list.forEach(function (secret) { + var id = KeyVault.parseSecretIdentifier(secret.id); + client.deleteSecret(id.vault, id.name, function (err, bundle) { }); + }); + } + callback(); + }); + } + else callback(); + } + +}); \ No newline at end of file diff --git a/test/services/keyVault/kv-test-utils.js b/test/services/keyVault/kv-test-utils.js index b1b650ee3..e7ce979ff 100644 --- a/test/services/keyVault/kv-test-utils.js +++ b/test/services/keyVault/kv-test-utils.js @@ -23,6 +23,7 @@ var Forge = require('node-forge'); var BigInteger = Forge.jsbn.BigInteger; var Random = require('random-js'); var util = require('util'); +var should = require('should'); var exports = module.exports; @@ -35,7 +36,7 @@ exports.authenticator = function(challenge, callback) { var clientId = process.env['AZURE_KV_CLIENT_ID']; var clientSecret = process.env['AZURE_KV_CLIENT_SECRET']; - if (!clientId) clientId = 'mocked'; + if (!clientId) clientId = 'a2a96829-36de-4f0a-9b7b-c26a3377242e'; if (!clientSecret) clientSecret = 'mocked'; // Create a new authentication context. @@ -112,11 +113,11 @@ function clone(obj) { return new Buffer(obj); } if (obj instanceof Object) { - if (obj instanceof KeyVault.JsonWebKey) result = new KeyVault.JsonWebKey(); + if (obj instanceof KeyVault.Models.JsonWebKey) result = new KeyVault.Models.JsonWebKey(); else - if (obj instanceof KeyVault.KeyAttributes) result = new KeyVault.KeyAttributes(); + if (obj instanceof KeyVault.Models.KeyAttributes) result = new KeyVault.Models.KeyAttributes(); else - if (obj instanceof KeyVault.SecretAttributes) result = new KeyVault.SecretAttributes(); + if (obj instanceof KeyVault.Models.SecretAttributes) result = new KeyVault.Models.SecretAttributes(); else result = {}; @@ -125,6 +126,7 @@ function clone(obj) { result[p] = clone(obj[p]); } } + return result; } return obj; @@ -169,7 +171,7 @@ exports.validateSecretBundle = function(bundle, vault, secretName, secretValue) }; exports.validateSecretList = function(result, expected) { - var secrets = result.value; + var secrets = result; if (secrets && secrets.length) { for (var i = 0; i < secrets.length; ++i) { var secret = secrets[i]; @@ -183,7 +185,7 @@ exports.validateSecretList = function(result, expected) { } }; -exports.validateRsaKeyBundle = function(bundle, vault, keyName, kty, key_ops) { +exports.validateRsaKeyBundle = function(bundle, vault, keyName, kty, keyOps) { var prefix = vault + '/keys/' + keyName + '/'; var key = bundle.key; var kid = key.kid; @@ -196,11 +198,11 @@ exports.validateRsaKeyBundle = function(bundle, vault, keyName, kty, key_ops) { if (!key.n || !key.e) { throw new Error('Bad RSA public material.'); } - if (key_ops != null) { - var expected = JSON.stringify(key_ops); - var actual = JSON.stringify(key.key_ops); + if (keyOps != null) { + var expected = JSON.stringify(keyOps); + var actual = JSON.stringify(key.keyOps); if (actual !== expected) { - throw new Error(util.format('key_ops should be %s, but is %s.', expected, actual)); + throw new Error(util.format('keyOps should be %s, but is %s.', expected, actual)); } } var attributes = bundle.attributes; @@ -210,7 +212,7 @@ exports.validateRsaKeyBundle = function(bundle, vault, keyName, kty, key_ops) { }; exports.validateKeyList = function(result, expected) { - var keys = result.value; + var keys = result; if (keys && keys.length) { for (var i = 0; i < keys.length; ++i) { var key = keys[i]; @@ -224,6 +226,104 @@ exports.validateKeyList = function(result, expected) { } }; +exports.validateCertificateList = function (certificates, expected) { + + if (certificates && certificates.length) { + certificates.forEach(function (certificate) { + KeyVault.parseCertificateIdentifier(certificate.id); + var attributes = expected[certificate.id]; + if (attributes) { + exports.compareObjects(attributes, certificate.attributes); + delete expected[certificate.id]; + } + }); + } +}; + +exports.validateCertificateIssuerList = function (issuers, expected) { + + if (issuers && issuers.length) { + issuers.forEach(function (issuer) { + KeyVault.parseCertificateIdentifier(issuer.id); + var provider = expected[issuer.id]; + if (provider) { + should(provider).be.exactly(issuer.provider); + delete expected[issuer.id]; + } + }); + } +}; + +exports.validateCertificateOperation = function (pendingCertificate, vault, certificateName, policy) { + var identifier = KeyVault.parseCertificateOperationIdentifier(pendingCertificate.id); + should(identifier.vault).be.exactly(vault); + should(identifier.name).be.exactly(certificateName); + should.exist(pendingCertificate); + should.exist(pendingCertificate.csr); + should(policy.issuerReference.name).be.exactly(pendingCertificate.issuerReference.name); +}; + +exports.validateCertificateBundle = function (bundle, vault, certificateName, policy) { + var identifier = KeyVault.parseCertificateIdentifier(bundle.id); + should(identifier.vault).be.exactly(vault); + should(identifier.name).be.exactly(certificateName); + + should.exist(bundle); + should.exist(bundle.x509Thumbprint); + should.exist(bundle.policy); + should.exist(bundle.cer); + should.exist(bundle.attributes); + should.exist(bundle.policy.id); + should.exist(bundle.policy.issuerReference); + should.exist(bundle.policy.keyProperties); + should.exist(bundle.policy.secretProperties); + should.exist(bundle.policy.lifetimeActions); + should.exist(bundle.policy.x509CertificateProperties); + if (policy.secretProperties) + exports.compareObjects(policy.secretProperties, bundle.policy.secretProperties); + if (policy.keyProperties) + exports.compareObjects(policy.keyProperties, bundle.policy.keyProperties); + if (policy.x509CertificateProperties && policy.x509CertificateProperties.validityInMonths) + should(policy.x509CertificateProperties.validityInMonths).be.exactly(bundle.policy.x509CertificateProperties.validityInMonths); + + KeyVault.parseSecretIdentifier(bundle.sid); + KeyVault.parseKeyIdentifier(bundle.kid); +}; + + +exports.validateIssuerBundle = function (bundle, vault, issuerName, expectedBundle) { + var identifier = KeyVault.parseIssuerIdentifier(bundle.id); + should(identifier.vault).be.exactly(vault); + should(identifier.name).be.exactly(issuerName); + + should.exist(bundle); + should.exist(bundle.attributes); + should.exist(bundle.organizationDetails); + + should(bundle.provider).be.exactly(expectedBundle.provider); + + if (expectedBundle.credentials) + should(bundle.credentials.accountId).be.exactly(expectedBundle.credentials.accountId); + + if (expectedBundle.organizationDetails) + exports.compareObjects(expectedBundle.organizationDetails, bundle.organizationDetails); +}; + +exports.validateCertificateContacts = function (contacts, vault, expectedContacts) { + var contactId = vault + '/certificates/contacts'; + should(contactId).be.exactly(contacts.id); + should(expectedContacts.contactList.length).be.exactly(contacts.contactList.length); + + contacts.contactList.forEach(function (contact) { + var expectedContact = expectedContacts.contactList.find(function (element, index, array) { + if (element.emailAddress == contact.emailAddress) + return true; + return false; + }); + exports.compareObjects(expectedContact, contact); + }); +}; + exports.getTestKey = function(suiteUtil) { return getWellKnownKey(); }; @@ -263,4 +363,4 @@ function bigIntegerToBuffer(n) { data = data.slice(leadingZeroes); } return new Buffer(data); -} +} \ No newline at end of file diff --git a/test/testlist.txt b/test/testlist.txt index 62b641035..9498fdb01 100644 --- a/test/testlist.txt +++ b/test/testlist.txt @@ -15,8 +15,6 @@ common/storageservicesettings-tests.js serviceruntime/roleenvironment-tests.js serviceruntime/runtimeversionmanager-tests.js serviceruntime/runtimeversionprotocolclient-tests.js -#services/keyVault/keyVault-key-tests.js -#services/keyVault/keyVault-secret-tests.js services/blob/internal/sharedaccesssignature-tests.js services/blob/internal/sharedkey-tests.js services/blob/internal/sharedkeylite-tests.js diff --git a/test/testlistarm.txt b/test/testlistarm.txt index f4f37041a..a857f6116 100644 --- a/test/testlistarm.txt +++ b/test/testlistarm.txt @@ -20,4 +20,7 @@ services/servermanagement/servermanagement-tests.js services/notificationHubsManagement/namespace-tests.js services/notificationHubsManagement/notificationHub-tests.js services/devTestLabs/devTestLabsClient-tests.js -services/iothub/iothubClient-tests.js \ No newline at end of file +services/iothub/iothubClient-tests.js +services/keyVault/keyVault-key-tests.js +services/keyVault/keyVault-secret-tests.js +services/keyVault/keyVault-certificate-tests.js \ No newline at end of file