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
dd251895
Commit
dd251895
authored
Jul 28, 2017
by
Sietse Ringers
Browse files
More renaming
parent
aa45e3ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
identifiers.go
View file @
dd251895
...
...
@@ -2,60 +2,60 @@ package irmago
import
"strings"
type
o
bjectIdentifier
string
type
metaO
bjectIdentifier
string
// SchemeManagerIdentifier identifies a scheme manager. Equal to its ID. For example "irma-demo".
type
SchemeManagerIdentifier
struct
{
o
bjectIdentifier
metaO
bjectIdentifier
}
// IssuerIdentifier identifies an inssuer. For example "irma-demo.RU".
type
IssuerIdentifier
struct
{
o
bjectIdentifier
metaO
bjectIdentifier
}
// CredentialTypeIdentifier identifies a credentialtype. For example "irma-demo.RU.studentCard".
type
CredentialTypeIdentifier
struct
{
o
bjectIdentifier
metaO
bjectIdentifier
}
// AttributeTypeIdentifier identifies an attribute. For example "irma-demo.RU.studentCard.studentID".
type
AttributeTypeIdentifier
struct
{
o
bjectIdentifier
metaO
bjectIdentifier
}
func
(
oi
o
bjectIdentifier
)
Parent
()
string
{
func
(
oi
metaO
bjectIdentifier
)
Parent
()
string
{
str
:=
string
(
oi
)
return
str
[
:
strings
.
LastIndex
(
str
,
"."
)]
}
func
(
oi
o
bjectIdentifier
)
Name
()
string
{
func
(
oi
metaO
bjectIdentifier
)
Name
()
string
{
str
:=
string
(
oi
)
return
str
[
strings
.
LastIndex
(
str
,
"."
)
+
1
:
]
}
func
(
oi
o
bjectIdentifier
)
String
()
string
{
func
(
oi
metaO
bjectIdentifier
)
String
()
string
{
return
string
(
oi
)
}
// NewSchemeManagerIdentifier converts the specified identifier to a SchemeManagerIdentifier.
func
NewSchemeManagerIdentifier
(
id
string
)
SchemeManagerIdentifier
{
return
SchemeManagerIdentifier
{
o
bjectIdentifier
(
id
)}
return
SchemeManagerIdentifier
{
metaO
bjectIdentifier
(
id
)}
}
// NewIssuerIdentifier converts the specified identifier to a IssuerIdentifier.
func
NewIssuerIdentifier
(
id
string
)
IssuerIdentifier
{
return
IssuerIdentifier
{
o
bjectIdentifier
(
id
)}
return
IssuerIdentifier
{
metaO
bjectIdentifier
(
id
)}
}
// NewCredentialTypeIdentifier converts the specified identifier to a CredentialTypeIdentifier.
func
NewCredentialTypeIdentifier
(
id
string
)
CredentialTypeIdentifier
{
return
CredentialTypeIdentifier
{
o
bjectIdentifier
(
id
)}
return
CredentialTypeIdentifier
{
metaO
bjectIdentifier
(
id
)}
}
// NewAttributeTypeIdentifier converts the specified identifier to a AttributeTypeIdentifier.
func
NewAttributeTypeIdentifier
(
id
string
)
AttributeTypeIdentifier
{
return
AttributeTypeIdentifier
{
o
bjectIdentifier
(
id
)}
return
AttributeTypeIdentifier
{
metaO
bjectIdentifier
(
id
)}
}
// SchemeManagerIdentifier returns the scheme manager identifer of the issuer.
...
...
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