github.com/jlmucb/cloudproxy@v0.0.0-20170830161738-b5aa0b619bc4/go/apps/roughtime/server/server.go (about) 1 // Copyright (c) 2016, Google Inc. All rights reserved. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 // this is an adapted version of the server code in the roughtime for cloudproxy. 16 // it uses Tao to prove its identity. 17 package main 18 19 import ( 20 "crypto/x509/pkix" 21 "flag" 22 "log" 23 24 "github.com/jlmucb/cloudproxy/go/apps/roughtime" 25 "github.com/jlmucb/cloudproxy/go/tao" 26 ) 27 28 var ( 29 port = flag.Int("port", 5333, "Port number to listen on") 30 configPath = flag.String("config", "tao.config", "Path to domain configuration file.") 31 ) 32 33 // x509 identity. 34 var x509Identity pkix.Name = pkix.Name{ 35 Organization: []string{"Google Inc."}, 36 OrganizationalUnit: []string{"Cloud Security"}, 37 } 38 39 func main() { 40 flag.Parse() 41 42 s, err := roughtime.NewServer(*configPath, "tcp", *port, 43 &x509Identity, tao.Parent()) 44 if err != nil { 45 log.Fatal(err) 46 } 47 err = s.ServeForever() 48 if err != nil { 49 log.Fatal(err) 50 } 51 }