client.encryption
この名前空間のすべてのメソッドの、シグネチャ、パラメーター、戻り値、例。
メソッド
The OpenPGP public keys that let senders seal mail to your addresses: list the ones you published, publish or rotate one, and look up the keys of recipients before sealing a message.
encryption.list_keys
List your published encryption keys
list_keys(api_key: nil) -> Array<Hash>Returns every OpenPGP public key published for an address in this workspace, newest first, the Encryption page of the app. Retired keys are included, with revokedAt and revokedReason set, and the live key of each address has revokedAt nil.
Published keys belong to a person. A key reads and publishes the keys of the workspace owner, and an access token those of the person who connected the app. A key limited to particular addresses lists only the keys of those addresses.
パラメーター
api_keyStringOverrides the client's API key for this call only.
戻り値
An Array of Hashes, each with id, address, fingerprint, publicKey, algorithm, createdAt, revokedAt and revokedReason.
例
keys = client.encryption.list_keys keys.each do |key| state = key[:revokedAt].nil? ? "live" : "retired" puts "#{key[:address]} #{key[:fingerprint]} #{state}"end注意事項
Only public keys travel through the API. The private key stays on the device that made it.
ほかの提供先
encryption.publish_key
Publish a public key for one of your addresses
publish_key(body = nil, api_key: nil, **fields) -> HashPublishes an armored OpenPGP public key for one of your addresses, so that senders can seal mail to it, as Publish on the Encryption page does. The address has to be an address of this workspace on a verified domain, switched on, and one you may use.
An address keeps one live key. To rotate, pass the fingerprint of the live key as replaces: it is retired as the new key is published. Mail already sealed to the old key stays readable only with the old private key.
Published keys belong to a person. A key reads and publishes the keys of the workspace owner, and an access token those of the person who connected the app.
パラメーター
addressString必須The address the key is for.
publicKeyString必須The armored OpenPGP PUBLIC KEY BLOCK, up to 64 KB.
fingerprintString必須The fingerprint of the key, 40 upper-case hexadecimal characters.
algorithmStringThe algorithm of the key, such as
ed25519, for display only.replacesStringThe fingerprint of the live key this one replaces, to rotate it.
api_keyStringOverrides the client's API key for this call only.
戻り値
A Hash for the key, now live, with the same fields as each entry of encryption.list_keys.
例
key = client.encryption.publish_key( address: "[email protected]", publicKey: File.read("key.asc"), fingerprint: "3F2A9C1B7E4D5F60A1B2C3D4E5F60718293A4B5C") puts key[:id]注意事項
With an OAuth access token it asks for a verification code: until the app has verified one, it is refused with 403
step_up_required. An API key is never asked.A second key while one is live, without
replaces, is 409key_already_published, and so is a key that was published for the address before. An address on a domain that is not verified yet is 409domain_not_verified, and an address you may not use is 403address_not_allowed.The SDK does not retry it.
ほかの提供先
encryption.lookup_keys
Find the keys to seal mail to
lookup_keys(addresses:, api_key: nil) -> Array<Hash>Returns the live public keys published for each recipient address, the lookup the composer makes before it seals a message. An address with no key comes back with keys empty, so mail to it cannot be sealed. Only keys published by somebody who can read the address count.
パラメーター
addressesArray<String>必須Recipient addresses, at most 51, sent comma-separated.
api_keyStringOverrides the client's API key for this call only.
戻り値
An Array of Hashes, one per address, each with address and keys, every key a Hash with fingerprint, publicKey and createdAt.
例
found = client.encryption.lookup_keys(addresses: ["[email protected]", "[email protected]"]) sealable = found.all? { |entry| entry[:keys].any? }puts sealable注意事項
A display name in angle brackets is read as its address.