Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
IRMA
Github mirrors
irmago
Commits
1e108599
Commit
1e108599
authored
Aug 29, 2017
by
Sietse Ringers
Browse files
Wip on issuance
parent
79c2f2e7
Changes
2
Hide whitespace changes
Inline
Side-by-side
manager.go
View file @
1e108599
...
@@ -20,6 +20,7 @@ type CredentialManager struct {
...
@@ -20,6 +20,7 @@ type CredentialManager struct {
storagePath
string
storagePath
string
attributes
map
[
CredentialTypeIdentifier
][]
*
AttributeList
attributes
map
[
CredentialTypeIdentifier
][]
*
AttributeList
credentials
map
[
CredentialTypeIdentifier
]
map
[
int
]
*
Credential
credentials
map
[
CredentialTypeIdentifier
]
map
[
int
]
*
Credential
issuance
issuanceState
}
}
func
newCredentialManager
()
*
CredentialManager
{
func
newCredentialManager
()
*
CredentialManager
{
...
@@ -301,3 +302,17 @@ func (cm *CredentialManager) Proofs(choice *DisclosureChoice, request SessionReq
...
@@ -301,3 +302,17 @@ func (cm *CredentialManager) Proofs(choice *DisclosureChoice, request SessionReq
return
gabi
.
BuildProofList
(
request
.
GetContext
(),
request
.
GetNonce
(),
builders
,
issig
),
nil
return
gabi
.
BuildProofList
(
request
.
GetContext
(),
request
.
GetNonce
(),
builders
,
issig
),
nil
}
}
type
issuanceState
struct
{
builders
[]
*
gabi
.
CredentialBuilder
nonce2
*
big
.
Int
}
func
(
cm
*
CredentialManager
)
IssueCommitments
(
choice
*
DisclosureChoice
,
request
SessionRequest
)
(
gabi
.
IssueCommitmentMessage
,
error
)
{
cm
.
issuance
=
issuanceState
{[]
*
gabi
.
CredentialBuilder
{},
nil
}
todisclose
,
err
:=
cm
.
groupCredentials
(
choice
)
if
err
!=
nil
{
return
nil
,
err
}
}
protocol/requests.go
View file @
1e108599
...
@@ -86,7 +86,7 @@ func NewServiceProviderJwt(servername string, dr DisclosureRequest) *ServiceProv
...
@@ -86,7 +86,7 @@ func NewServiceProviderJwt(servername string, dr DisclosureRequest) *ServiceProv
}
}
}
}
func
NewSignatureServerJwt
(
servername
string
,
d
r
SignatureRequest
)
*
SignatureServerJwt
{
func
NewSignatureServerJwt
(
servername
string
,
s
r
SignatureRequest
)
*
SignatureServerJwt
{
now
:=
Timestamp
(
time
.
Now
())
now
:=
Timestamp
(
time
.
Now
())
return
&
SignatureServerJwt
{
return
&
SignatureServerJwt
{
ServerJwt
:
ServerJwt
{
ServerJwt
:
ServerJwt
{
...
@@ -94,10 +94,30 @@ func NewSignatureServerJwt(servername string, dr SignatureRequest) *SignatureSer
...
@@ -94,10 +94,30 @@ func NewSignatureServerJwt(servername string, dr SignatureRequest) *SignatureSer
IssuedAt
:
&
now
,
IssuedAt
:
&
now
,
Type
:
"signature_request"
,
Type
:
"signature_request"
,
},
},
Request
:
SignatureServerRequest
{
Request
:
d
r
},
Request
:
SignatureServerRequest
{
Request
:
s
r
},
}
}
}
}
func
NewIdentityProviderJwt
(
servername
string
,
ir
IssuanceRequest
)
*
IdentityProviderJwt
{
now
:=
Timestamp
(
time
.
Now
())
return
&
IdentityProviderJwt
{
ServerJwt
:
ServerJwt
{
ServerName
:
servername
,
IssuedAt
:
&
now
,
Type
:
"signature_request"
,
},
Request
:
IdentityProviderRequest
{
Request
:
ir
},
}
}
func
(
ir
*
IssuanceRequest
)
GetContext
()
*
big
.
Int
{
return
ir
.
Context
}
func
(
ir
*
IssuanceRequest
)
GetNonce
()
*
big
.
Int
{
return
ir
.
Nonce
}
func
(
dr
*
DisclosureRequest
)
GetContext
()
*
big
.
Int
{
func
(
dr
*
DisclosureRequest
)
GetContext
()
*
big
.
Int
{
return
dr
.
Context
return
dr
.
Context
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment