Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROMEOS_DBUS_EASY_UNLOCK_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_EASY_UNLOCK_CLIENT_H_ |
| 6 #define CHROMEOS_DBUS_EASY_UNLOCK_CLIENT_H_ | 6 #define CHROMEOS_DBUS_EASY_UNLOCK_CLIENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 55 // encryption is required, the key must be symetric. | 55 // encryption is required, the key must be symetric. |
| 56 // |associated_data|: Data associated with the message. The data will not | 56 // |associated_data|: Data associated with the message. The data will not |
| 57 // actually be added to the message, but it will be used while | 57 // actually be added to the message, but it will be used while |
| 58 // signing the message (the receiver will use the same data to | 58 // signing the message (the receiver will use the same data to |
| 59 // authenticate the signature). | 59 // authenticate the signature). |
| 60 // |public_metadata|: Metadata added to the message header. | 60 // |public_metadata|: Metadata added to the message header. |
| 61 // |verification_key_id|: The key id added to the message header. Has to be | 61 // |verification_key_id|: The key id added to the message header. Has to be |
| 62 // set if the message is signed with private asymetric key. This value | 62 // set if the message is signed with private asymetric key. This value |
| 63 // is used by the receiver to identify the public key that should be used | 63 // is used by the receiver to identify the public key that should be used |
| 64 // to verify the signature. | 64 // to verify the signature. |
| 65 // |decryption_key_id|: Key id added to the message header. Used by the | |
| 66 // message receiver to identify the key that should be used to decrypt | |
| 67 // the message. | |
| 65 // |encryption_type|: The encryption algorithm to use for encrypting the | 68 // |encryption_type|: The encryption algorithm to use for encrypting the |
| 66 // message. (May be set to none). | 69 // message. (May be set to none). |
| 67 // |signature_type|: The algorithm to use to sign the message. | 70 // |signature_type|: The algorithm to use to sign the message. |
| 68 // |callback|: Called with the created message. On failure, the message will | 71 // |callback|: Called with the created message. On failure, the message will |
| 69 // be empty. | 72 // be empty. |
| 70 virtual void CreateSecureMessage(const std::string& payload, | 73 virtual void CreateSecureMessage(const std::string& payload, |
| 71 const std::string& secret_key, | 74 const std::string& secret_key, |
| 72 const std::string& associated_data, | 75 const std::string& associated_data, |
| 73 const std::string& public_metadata, | 76 const std::string& public_metadata, |
| 74 const std::string& verification_key_id, | 77 const std::string& verification_key_id, |
| 78 const std::string& decryption_key_id, | |
| 75 const std::string& encryption_type, | 79 const std::string& encryption_type, |
| 76 const std::string& signature_type, | 80 const std::string& signature_type, |
| 77 const DataCallback& callback) = 0; | 81 const DataCallback& callback) = 0; |
|
stevenjb
2014/09/02 16:09:25
nit: For future consideration, passing this many a
| |
| 78 | 82 |
| 79 // Authenticates and, if specified, decrypts a secure message. | 83 // Authenticates and, if specified, decrypts a secure message. |
| 80 // |message|: The message to unwrap. It is in the same format as the message | 84 // |message|: The message to unwrap. It is in the same format as the message |
| 81 // returned by |CreateSecureMessage|. | 85 // returned by |CreateSecureMessage|. |
| 82 // |key|: The key used to authenticate message signature and, if needed, | 86 // |key|: The key used to authenticate message signature and, if needed, |
| 83 // decrypt the message. If the message is encrypted, only symetric key | 87 // decrypt the message. If the message is encrypted, only symetric key |
| 84 // can be used. | 88 // can be used. |
| 85 // |associated_data|: Data associated with the message. Message | 89 // |associated_data|: Data associated with the message. Message |
| 86 // authentication will succeed only if the message was created with the | 90 // authentication will succeed only if the message was created with the |
| 87 // associated data. | 91 // associated data. |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 106 // Create() should be used instead. | 110 // Create() should be used instead. |
| 107 EasyUnlockClient(); | 111 EasyUnlockClient(); |
| 108 | 112 |
| 109 private: | 113 private: |
| 110 DISALLOW_COPY_AND_ASSIGN(EasyUnlockClient); | 114 DISALLOW_COPY_AND_ASSIGN(EasyUnlockClient); |
| 111 }; | 115 }; |
| 112 | 116 |
| 113 } // namespace chromeos | 117 } // namespace chromeos |
| 114 | 118 |
| 115 #endif // CHROMEOS_DBUS_EASY_UNLOCK_CLIENT_H_ | 119 #endif // CHROMEOS_DBUS_EASY_UNLOCK_CLIENT_H_ |
| OLD | NEW |