-
Notifications
You must be signed in to change notification settings - Fork 127
/
Credential.java
208 lines (181 loc) · 4.72 KB
/
Credential.java
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
package com.auth0.json.mgmt.client;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Date;
/**
* Class that represents an Auth0 application credential object. Related to the {@link com.auth0.client.mgmt.ClientsEntity} entity.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Credential {
@JsonProperty("credential_type")
private String credentialType;
@JsonProperty("name")
private String name;
@JsonProperty("pem")
private String pem;
@JsonProperty("id")
private String id;
@JsonProperty("kid")
private String kid;
@JsonProperty("thumbprint")
private String thumbprint;
@JsonProperty("alg")
private String alg;
@JsonProperty("parse_expiry_from_cert")
private Boolean parseExpiryFromCert;
@JsonProperty("subject_dn")
private String subjectDn;
@JsonFormat(shape = JsonFormat.Shape.STRING)
@JsonProperty("created_at")
private Date createdAt;
@JsonFormat(shape = JsonFormat.Shape.STRING)
@JsonProperty("updated_at")
private Date updatedAt;
@JsonFormat(shape = JsonFormat.Shape.STRING)
@JsonProperty("expires_at")
private Date expiresAt;
/**
* Create a new credential
* @param credentialType the credential type
* @param pem the PEM
*/
public Credential(String credentialType, String pem) {
this.credentialType = credentialType;
this.pem = pem;
}
/**
* Create a new credential
* @param id the ID of the credential
*/
public Credential(String id) {
this.id = id;
}
/**
* Create a new credential
*/
public Credential() {}
/**
* @return the credential type
*/
public String getCredentialType() {
return credentialType;
}
/**
* Sets the credential type
* @param credentialType the credential type
*/
public void setCredentialType(String credentialType) {
this.credentialType = credentialType;
}
/**
* @return the credential name
*/
public String getName() {
return name;
}
/**
* Sets the credential name
* @param name the name of the credential
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the credential's PEM
*/
public String getPem() {
return pem;
}
/**
* Sets the credential's PEM
* @param pem the PEM of the credential
*/
public void setPem(String pem) {
this.pem = pem;
}
/**
* @return the ID of the credential
*/
public String getId() {
return id;
}
/**
* @return the KID of the credential
*/
public String getKid() {
return kid;
}
/**
* @return the thumbprint of the credential
*/
public String getThumbprint() {
return thumbprint;
}
/**
* @return the date the credential was created at
*/
public Date getCreatedAt() {
return createdAt;
}
/**
* @return the algorithm of this credential
*/
public String getAlg() {
return alg;
}
/**
* Set the algorithm
* @param alg the algorithm
*/
public void setAlg(String alg) {
this.alg = alg;
}
/**
* @return the time this credential was last updated
*/
public Date getUpdatedAt() {
return updatedAt;
}
/**
* @return the expiration time of this credential
*/
public Date getExpiresAt() {
return expiresAt;
}
/**
* Set the expires_at value for this credential
* @param expiresAt the time this credential should expire
*/
public void setExpiresAt(Date expiresAt) {
this.expiresAt = expiresAt;
}
/**
* @return whether the expiry will be parsed from the x509 certificate
*/
public Boolean getParseExpiryFromCert() {
return parseExpiryFromCert;
}
/**
* Whether to parse expiry from x509 certificate
* @param parseExpiryFromCert true to parse expiry; false otherwise.
*/
public void setParseExpiryFromCert(Boolean parseExpiryFromCert) {
this.parseExpiryFromCert = parseExpiryFromCert;
}
/**
* @return the value of the {@code subject_dn} field
*/
public String getSubjectDn() {
return subjectDn;
}
/**
* Sets the value of the {@code subject_dn} field
* @param subjectDn the value of the {@code subject_dn} field
*/
public void setSubjectDn(String subjectDn) {
this.subjectDn = subjectDn;
}
}