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
bde25dff
Commit
bde25dff
authored
Jul 26, 2018
by
Sietse Ringers
Browse files
Make CredentialInfo field names more consistent
Co-authored-by:
Confiks
<
confiks@scriptbase.org
>
parent
e08bc68e
Changes
1
Hide whitespace changes
Inline
Side-by-side
credinfo.go
View file @
bde25dff
...
...
@@ -8,9 +8,9 @@ import (
// CredentialInfo contains all information of an IRMA credential.
type
CredentialInfo
struct
{
ID
string
// e.g., "studentCard"
CredentialTypeID
CredentialTypeIdentifier
// e.g., "irma-demo.RU.studentCard"
Name
string
// e.g., "studentCard"
IssuerID
IssuerIdentifier
// e.g., "RU"
IssuerID
IssuerIdentifier
// e.g., "irma-demo.RU"
SchemeManagerID
SchemeManagerIdentifier
// e.g., "irma-demo"
Index
int
// This is the Index-th credential instance of this type
SignedOn
Timestamp
// Unix timestamp
...
...
@@ -35,9 +35,9 @@ func NewCredentialInfo(ints []*big.Int, conf *Configuration) *CredentialInfo {
issid
:=
id
.
IssuerIdentifier
()
return
&
CredentialInfo
{
CredentialTypeID
:
NewCredentialTypeIdentifier
(
id
.
String
()),
Name
:
id
.
Name
(),
IssuerID
:
NewIssuerIdentifier
(
issid
.
Name
())
,
SchemeManagerID
:
NewSchemeManagerIdentifier
(
issid
.
SchemeManagerIdentifier
()
.
String
())
,
ID
:
id
.
Name
(),
IssuerID
:
issid
,
SchemeManagerID
:
issid
.
SchemeManagerIdentifier
(),
SignedOn
:
Timestamp
(
meta
.
SigningDate
()),
Expires
:
Timestamp
(
meta
.
Expiry
()),
Attributes
:
attrs
.
Strings
(),
...
...
@@ -68,5 +68,5 @@ func (cl CredentialInfoList) Swap(i, j int) {
// Less implements sort.Interface.
func
(
cl
CredentialInfoList
)
Less
(
i
,
j
int
)
bool
{
// TODO Decide on sorting, and if it depends on a irmago.TranslatedString, allow language choosing
return
strings
.
Compare
(
cl
[
i
]
.
Name
,
cl
[
j
]
.
Name
)
>
0
return
strings
.
Compare
(
cl
[
i
]
.
ID
,
cl
[
j
]
.
ID
)
>
0
}
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