Skip to content
GitLab
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
850fa020
Commit
850fa020
authored
Oct 06, 2017
by
Sietse Ringers
Browse files
Add CredentialInfoList to issuance requests
parent
f4122790
Changes
4
Hide whitespace changes
Inline
Side-by-side
credential.go
View file @
850fa020
...
...
@@ -29,7 +29,7 @@ type CredentialInfo struct {
Expires
Timestamp
// Unix timestamp
Attributes
[]
TranslatedString
// Human-readable rendered attributes
Logo
string
// Path to logo on storage
Hash
string
// SHA256 hash over the attributes
Hash
string
// SHA256 hash over the attributes
}
// A CredentialInfoList is a list of credentials (implements sort.Interface).
...
...
@@ -53,9 +53,13 @@ func NewCredentialInfo(ints []*big.Int, store *ConfigurationStore) *CredentialIn
if
!
exists
{
path
=
""
}
id
:=
credtype
.
Identifier
()
issid
:=
id
.
IssuerIdentifier
()
return
&
CredentialInfo
{
CredentialTypeID
:
credtype
.
Identifier
()
.
String
(),
CredentialTypeID
:
id
.
String
(),
Name
:
id
.
Name
(),
IssuerID
:
issid
.
Name
(),
SchemeManagerID
:
issid
.
SchemeManagerIdentifier
()
.
String
(),
SignedOn
:
Timestamp
(
meta
.
SigningDate
()),
Expires
:
Timestamp
(
meta
.
Expiry
()),
Attributes
:
attrs
,
...
...
messages.go
View file @
850fa020
...
...
@@ -98,6 +98,8 @@ const (
ErrorApi
=
ErrorType
(
"api"
)
// Server returned unexpected or malformed response
ErrorServerResponse
=
ErrorType
(
"serverResponse"
)
// Credential type not present in our ConfigurationStore
ErrorUnknownCredentialType
=
ErrorType
(
"unknownCredentialType"
)
)
func
(
e
*
SessionError
)
Error
()
string
{
...
...
requests.go
View file @
850fa020
...
...
@@ -47,8 +47,9 @@ type SignatureRequest struct {
// optionally also asking for certain attributes to be simultaneously disclosed.
type
IssuanceRequest
struct
{
SessionRequest
Credentials
[]
*
CredentialRequest
`json:"credentials"`
Disclose
AttributeDisjunctionList
`json:"disclose"`
Credentials
[]
*
CredentialRequest
`json:"credentials"`
Disclose
AttributeDisjunctionList
`json:"disclose"`
CredentialInfoList
CredentialInfoList
`json:",omitempty"`
state
*
issuanceState
}
...
...
@@ -110,6 +111,14 @@ type issuanceState struct {
builders
[]
*
gabi
.
CredentialBuilder
}
func
(
cr
*
CredentialRequest
)
Info
(
store
*
ConfigurationStore
)
(
*
CredentialInfo
,
error
)
{
list
,
err
:=
cr
.
AttributeList
(
store
)
if
err
!=
nil
{
return
nil
,
err
}
return
NewCredentialInfo
(
list
.
Ints
,
store
),
nil
}
// AttributeList returns the list of attributes from this credential request.
func
(
cr
*
CredentialRequest
)
AttributeList
(
store
*
ConfigurationStore
)
(
*
AttributeList
,
error
)
{
meta
:=
NewMetadataAttribute
()
...
...
session.go
View file @
850fa020
...
...
@@ -157,9 +157,16 @@ func (session *session) start() {
session
.
irmaSession
.
SetContext
(
session
.
info
.
Context
)
session
.
irmaSession
.
SetNonce
(
session
.
info
.
Nonce
)
if
session
.
Action
==
ActionIssuing
{
ir
:=
session
.
irmaSession
.
(
*
IssuanceRequest
)
// Store which public keys the server will use
for
_
,
credreq
:=
range
session
.
irmaSession
.
(
*
IssuanceRequest
)
.
Credentials
{
for
_
,
credreq
:=
range
ir
.
Credentials
{
credreq
.
KeyCounter
=
session
.
info
.
Keys
[
credreq
.
CredentialTypeID
.
IssuerIdentifier
()]
info
,
err
:=
credreq
.
Info
(
session
.
credManager
.
ConfigurationStore
)
if
err
!=
nil
{
session
.
fail
(
&
SessionError
{
ErrorType
:
ErrorUnknownCredentialType
,
Err
:
err
})
return
}
ir
.
CredentialInfoList
=
append
(
ir
.
CredentialInfoList
,
info
)
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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