update code to latest go
[epoint] / pkg / key / key.go
index 6f2a322..19537d6 100644 (file)
@@ -78,8 +78,8 @@ func New(priv *dsa.PrivateKey, t time.Time, name, comment, email string) (e *ope
                return nil, fmt.Errorf("NewEntity: invalid argument: user id field contained invalid characters")
        }
        e = &openpgp.Entity{
-               PrimaryKey: packet.NewDSAPublicKey(t, &priv.PublicKey, false /* not a subkey */ ),
-               PrivateKey: packet.NewDSAPrivateKey(t, priv, false /* not a subkey */ ),
+               PrimaryKey: packet.NewDSAPublicKey(t, &priv.PublicKey),
+               PrivateKey: packet.NewDSAPrivateKey(t, priv),
                Identities: make(map[string]*openpgp.Identity),
        }
        isPrimaryId := true
@@ -128,6 +128,10 @@ func Issuer(r []byte, denomination string) (e *openpgp.Entity, err error) {
 func Holder(r []byte, issuer, denomination string) (e *openpgp.Entity, err error) {
        return New(DsaKey(r), time.Unix(0,0), "Holder of "+issuer, denomination, "")
 }
+// Server generates a key for the server from random seed r
+func Server(r []byte) (e *openpgp.Entity, err error) {
+       return New(DsaKey(r), time.Now(), "Server", "", "")
+}
 
 // Key id (fingerprint)
 func Id(e *openpgp.Entity) string {