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
d9e9004b
Commit
d9e9004b
authored
Jun 04, 2017
by
Sietse Ringers
Browse files
Add some more getters on identifiers
parent
7d0fa81d
Changes
1
Hide whitespace changes
Inline
Side-by-side
identifiers.go
View file @
d9e9004b
...
...
@@ -50,7 +50,6 @@ func (o *objectIdentifier) split() []string {
if
o
.
parts
==
nil
{
o
.
parts
=
strings
.
Split
(
o
.
string
,
"."
)
}
return
o
.
parts
}
...
...
@@ -67,11 +66,8 @@ func (ci *CredentialTypeIdentifier) IssuerName() string {
// IssuerIdentifier returns the issuer identifier of the current credential type.
func
(
ci
*
CredentialTypeIdentifier
)
IssuerIdentifier
()
*
IssuerIdentifier
{
if
ci
.
issuer
==
nil
{
ci
.
issuer
=
&
IssuerIdentifier
{
objectIdentifier
:
objectIdentifier
{
string
:
ci
.
SchemeManagerName
()
+
"."
+
ci
.
IssuerName
()},
}
ci
.
issuer
=
NewIssuerIdentifier
(
strings
.
Join
(
ci
.
split
()[
:
1
],
"."
))
}
return
ci
.
issuer
}
...
...
@@ -79,3 +75,36 @@ func (ci *CredentialTypeIdentifier) IssuerIdentifier() *IssuerIdentifier {
func
(
ci
*
CredentialTypeIdentifier
)
CredentialName
()
string
{
return
ci
.
split
()[
2
]
}
// SchemeManagerName ...
func
(
ai
*
AttributeTypeIdentifier
)
SchemeManagerName
()
string
{
return
ai
.
split
()[
0
]
}
// IssuerName ...
func
(
ai
*
AttributeTypeIdentifier
)
IssuerName
()
string
{
return
ai
.
split
()[
1
]
}
// CredentialName ...
func
(
ai
*
AttributeTypeIdentifier
)
CredentialName
()
string
{
return
ai
.
split
()[
2
]
}
// AttributeName ..
func
(
ai
*
AttributeTypeIdentifier
)
AttributeName
()
string
{
return
ai
.
split
()[
3
]
}
// CredentialTypeIdentifier ...
func
(
ai
*
AttributeTypeIdentifier
)
CredentialTypeIdentifier
()
*
CredentialTypeIdentifier
{
if
ai
.
cred
==
nil
{
ai
.
cred
=
NewCredentialTypeIdentifier
(
strings
.
Join
(
ai
.
split
()[
:
2
],
"."
))
}
return
ai
.
cred
}
// IssuerIdentifier ...
func
(
ai
*
AttributeTypeIdentifier
)
IssuerIdentifier
()
*
IssuerIdentifier
{
return
ai
.
CredentialTypeIdentifier
()
.
IssuerIdentifier
()
}
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