Exemplo n.º 1
0
def createNewKey(connection, passphrase, name, description):
  secret_key = crypto.newRandomSecretKey()
  data = {
    "name": crypto.createEncryption(secret_key, name),
    "description": crypto.createEncryption(secret_key, description),
    "encryptions": [
      crypto.createEncryptionWithPassphrase(secret_key, passphrase),
    ],
  }
  del secret_key
  return connection.post("/api/keys", data)
Exemplo n.º 2
0
def createNewSecretProperty(connection, key_id, secret_id, secret_key, name, value):
  data = {
    "name": crypto.createEncryption(secret_key, name),
    "value": crypto.createEncryption(secret_key, value),
  }
  return connection.post("/api/keys/%s/secrets/%s/properties" % (key_id, secret_id), data)
Exemplo n.º 3
0
def createNewSecret(connection, key_id, secret_key, name, description):
  data = {
    "name": crypto.createEncryption(secret_key, name),
    "description": crypto.createEncryption(secret_key, description),
  }
  return connection.post("/api/keys/%s/secrets" % key_id, data)