Commit b2f2c486 authored by Sietse Ringers's avatar Sietse Ringers
Browse files

Move stuff

parent a81872bd
package protocol
import (
"fmt"
"strconv"
"time"
)
const (
DISCLOSING = "disclosing"
ISSUING = "issuing"
SIGNING = "signing"
)
type Timestamp time.Time
type Qr struct {
Url string `json:"u"`
ProtocolVersion string `json:"v"`
ProtocolMaxVersion string `json:"vmax"`
Type string `json:"irmaqr"`
}
func (t *Timestamp) MarshalJSON() ([]byte, error) {
ts := time.Time(*t).Unix()
stamp := fmt.Sprint(ts)
return []byte(stamp), nil
}
func (t *Timestamp) UnmarshalJSON(b []byte) error {
ts, err := strconv.Atoi(string(b))
if err != nil {
return err
}
*t = Timestamp(time.Unix(int64(ts), 0))
return nil
}
......@@ -2,31 +2,10 @@ package protocol
import (
"math/big"
"time"
"fmt"
"strconv"
"github.com/credentials/irmago"
)
type Timestamp time.Time
func (t *Timestamp) MarshalJSON() ([]byte, error) {
ts := time.Time(*t).Unix()
stamp := fmt.Sprint(ts)
return []byte(stamp), nil
}
func (t *Timestamp) UnmarshalJSON(b []byte) error {
ts, err := strconv.Atoi(string(b))
if err != nil {
return err
}
*t = Timestamp(time.Unix(int64(ts), 0))
return nil
}
type SessionRequest struct {
Context *big.Int `json:"nonce"`
Nonce *big.Int `json:"context"`
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment