public class PushCertificateIdent extends Object
This is similar to a PersonIdent
in that it
contains a name, timestamp, and timezone offset, but differs in the following
ways:
getUserId()
, but getEmailAddress()
may return
null.getRaw()
. This is necessary for losslessly reconstructing the signed
push certificate payload.Constructor and Description |
---|
PushCertificateIdent(String userId,
long when,
int tzOffset)
Construct a new identity from an OpenPGP User ID.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
String |
getEmailAddress()
Get the email portion of the User ID
|
String |
getName()
Get the name portion of the User ID.
|
String |
getRaw()
Get the raw string from which this identity was parsed.
|
TimeZone |
getTimeZone()
Get this person's declared time zone
|
int |
getTimeZoneOffset()
Get this person's declared time zone as minutes east of UTC.
|
String |
getUserId()
Get the OpenPGP User ID, which may be any string.
|
Date |
getWhen()
Get the timestamp of the identity.
|
int |
hashCode() |
static PushCertificateIdent |
parse(String str)
Parse an identity from a string.
|
String |
toString() |
public PushCertificateIdent(String userId, long when, int tzOffset)
userId
- OpenPGP User ID; any UTF-8 string.when
- local time.tzOffset
- timezone offset; see getTimeZoneOffset()
.public static PushCertificateIdent parse(String str)
Spaces are trimmed when parsing the timestamp and timezone offset, with one exception. The timestamp must be preceded by a single space, and the rest of the string prior to that space (including any additional whitespace) is treated as the OpenPGP User ID.
If either the timestamp or timezone offsets are missing, mimics
RawParseUtils.parsePersonIdent(String)
behavior and sets them
both to zero.
str
- string to parse.PushCertificateIdent
object.public String getRaw()
If the string was constructed manually, a suitable canonical string is returned.
For the purposes of bytewise comparisons with other OpenPGP IDs, the string must be encoded as UTF-8.
public String getUserId()
public String getName()
getEmailAddress()
, returns the full User ID
with spaces trimmed.public String getEmailAddress()
getUserId()
, or null.public Date getWhen()
public TimeZone getTimeZone()
public int getTimeZoneOffset()
Copyright © 2020 Eclipse JGit Project. All rights reserved.