Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(495)

Side by Side Diff: mojo/services/vanadium/security/public/interfaces/principal.mojom

Issue 1261403003: Initial skeletal implementation of the PrincipalService. Also, use the Login()/GetUserBlessing() (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: minor logging fixes Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 module mojo;
jamesr 2015/08/17 21:38:22 i think this should go in a 'vanadium' module or s
gautham 2015/08/18 01:54:21 Done.
6
7 // Represents the name of an application. |url| is the url of the
8 // application. |qualifier| is a string that allows to tie a specific
9 // instance of an application to another.
10 struct AppInstanceName {
11 string url;
12 string? qualifier;
13 };
14
15 // Signature represents a digital signature of a message.
jamesr 2015/08/17 21:38:22 could you leave out the Signature and other concep
gautham 2015/08/18 01:54:22 Done.
16 struct Signature {
17 // Purpose of the signature. Can be used to prevent type attacks.
18 // The actual signature (R, S values for ECDSA keys) is produced by signing
19 // Hash(Hash(message), Hash(Purpose)).
20 array<uint8> purpose;
21 // Cryptographic hash function applied to the message before computing
22 // the signature.
23 enum Hash {
24 SHA1Hash = 1,
25 SHA256Hash,
26 SHA384Hash,
27 SHA512Hash,
28 };
29 Hash hash;
30 // Pair of integers that make up an ECDSA signature
31 array<uint8> r;
32 array<uint8> s;
33 };
34
35 // Certificate represents a human-readable name and public-key pair. The private -key
36 // for a certificate is only available for signing operations within the princip al
37 // service application.
38 struct Certificate {
39 string extension;
40 array<uint8>? publickey;
41 };
42
43 // Blessing is a credential binding a user identity to a public key. The corresp onding
44 // private key is only available for signing within the PrincipalService applica tion.
45 struct Blessing {
46 array<Certificate> chain;
47 };
48
49 // A service that binds user identities to an application instance running in Mo jo
50 interface PrincipalService {
51 // Login is called by an application instance (requestor_url/qualifier) that
52 // wants to get a user blessing. The service may obtain the user blessing
53 // through a third-party authentication flow (eg:oauth2). The user blessing
54 // is bound to a public/private key-pair that this service generates and
55 // persists for this application instance. Returns null if login fails.
56 Login() => (Blessing? user_blessing);
57
58 // Removes the user blessing for the application instance that invokes the
59 // Logout method.
60 Logout();
61
62 // Sign returns a signature on the message using the private key that is
63 // persisted for this application instance.
64 Sign(array<uint8> message) => (Signature? signature);
65
66 // GetUserBlessing returns the user blessing for a given application instance.
67 // It returns an error if the application instance has not invoked Login().
68 GetUserBlessing(AppInstanceName app) => (Blessing? user_blessing);
69 };
70
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698