-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathJOSEHeader.class.st
More file actions
100 lines (81 loc) · 1.75 KB
/
JOSEHeader.class.st
File metadata and controls
100 lines (81 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
"
Common superclass for Javascript Object Signing and Encryption headers (JOSE)
"
Class {
#name : 'JOSEHeader',
#superclass : 'Object',
#instVars : [
'properties',
'strict'
],
#category : 'JSONWebToken-Core-Headers',
#package : 'JSONWebToken-Core',
#tag : 'Headers'
}
{ #category : 'as yet unclassified' }
JOSEHeader class >> neoJsonMapping: mapper [
mapper for: self do: [ :mapping |
mapping
mapInstVar: #type to: #typ;
mapInstVar: #algorithm to: #alg ]
]
{ #category : 'comparing' }
JOSEHeader >> = aHeader [
^ aHeader hasSameElements: properties
]
{ #category : 'accessing' }
JOSEHeader >> at: aString [
^ strict
ifTrue: [ properties at: aString ]
ifFalse: [ properties at: aString ifAbsent: nil ]
]
{ #category : 'accessing' }
JOSEHeader >> at: aKey put: aValue [
properties at: aKey put: aValue
]
{ #category : 'initialization' }
JOSEHeader >> beLenient [
strict := false
]
{ #category : 'initialization' }
JOSEHeader >> beStrict [
strict := true
]
{ #category : 'testing' }
JOSEHeader >> hasSameElements: aDictionary [
^ (properties difference: aDictionary) isEmpty
]
{ #category : 'comparing' }
JOSEHeader >> hash [
^ properties hash
]
{ #category : 'initialization' }
JOSEHeader >> initialize [
super initialize.
strict := true
]
{ #category : 'accessing' }
JOSEHeader >> kid [
"Public Key ID"
^ properties at: 'kid'
]
{ #category : 'accessing' }
JOSEHeader >> kid: anObject [
properties at: 'kid' put: anObject
]
{ #category : 'accessing' }
JOSEHeader >> typ [
^ self type
]
{ #category : 'accessing' }
JOSEHeader >> typ: aString [
self type: aString
]
{ #category : 'accessing' }
JOSEHeader >> type [
^ properties at: 'typ'
]
{ #category : 'accessing' }
JOSEHeader >> type: anObject [
properties at: 'typ' put: anObject
]