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
c4ab7b22
Commit
c4ab7b22
authored
Oct 07, 2017
by
Sietse Ringers
Browse files
Fix bugs
parent
3c37d790
Changes
3
Show whitespace changes
Inline
Side-by-side
attributes.go
View file @
c4ab7b22
...
...
@@ -193,6 +193,9 @@ func (attr *MetadataAttribute) setValidityDuration(weeks int) {
}
func
(
attr
*
MetadataAttribute
)
setExpiryDate
(
timestamp
*
Timestamp
)
error
{
if
timestamp
==
nil
{
return
nil
}
expiry
:=
time
.
Time
(
*
timestamp
)
.
Unix
()
signing
:=
attr
.
SigningDate
()
.
Unix
()
attr
.
setValidityDuration
(
int
((
expiry
-
signing
)
/
ExpiryFactor
))
...
...
identifiers.go
View file @
c4ab7b22
...
...
@@ -48,7 +48,11 @@ type IrmaIdentifierSet struct {
// Parent returns the parent object of this identifier.
func
(
oi
metaObjectIdentifier
)
Parent
()
string
{
str
:=
string
(
oi
)
return
str
[
:
strings
.
LastIndex
(
str
,
"."
)]
if
i
:=
strings
.
LastIndex
(
str
,
"."
);
i
!=
-
1
{
return
str
[
:
i
]
}
else
{
return
str
}
}
// Name returns the last part of this identifier.
...
...
@@ -62,6 +66,15 @@ func (oi metaObjectIdentifier) String() string {
return
string
(
oi
)
}
func
(
oi
metaObjectIdentifier
)
Root
()
string
{
str
:=
string
(
oi
)
if
i
:=
strings
.
Index
(
str
,
"."
);
i
!=
-
1
{
return
str
[
:
i
]
}
else
{
return
str
}
}
// NewSchemeManagerIdentifier converts the specified identifier to a SchemeManagerIdentifier.
func
NewSchemeManagerIdentifier
(
id
string
)
SchemeManagerIdentifier
{
return
SchemeManagerIdentifier
{
metaObjectIdentifier
(
id
)}
...
...
requests.go
View file @
c4ab7b22
...
...
@@ -203,9 +203,15 @@ func (dr *IssuanceRequest) Identifiers() *IrmaIdentifierSet {
for
_
,
disjunction
:=
range
dr
.
Disclose
{
for
_
,
attr
:=
range
disjunction
.
Attributes
{
dr
.
identifiers
.
SchemeManagers
[
attr
.
CredentialTypeIdentifier
()
.
IssuerIdentifier
()
.
SchemeManagerIdentifier
()]
=
struct
{}{}
dr
.
identifiers
.
Issuers
[
attr
.
CredentialTypeIdentifier
()
.
IssuerIdentifier
()]
=
struct
{}{}
dr
.
identifiers
.
CredentialTypes
[
attr
.
CredentialTypeIdentifier
()]
=
struct
{}{}
var
cti
CredentialTypeIdentifier
if
!
attr
.
IsCredential
()
{
cti
=
attr
.
CredentialTypeIdentifier
()
}
else
{
cti
=
NewCredentialTypeIdentifier
(
attr
.
String
())
}
dr
.
identifiers
.
SchemeManagers
[
cti
.
IssuerIdentifier
()
.
SchemeManagerIdentifier
()]
=
struct
{}{}
dr
.
identifiers
.
Issuers
[
cti
.
IssuerIdentifier
()]
=
struct
{}{}
dr
.
identifiers
.
CredentialTypes
[
cti
]
=
struct
{}{}
}
}
}
...
...
Write
Preview
Supports
Markdown
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