Class SpiffeId
java.lang.Object
io.spiffe.spiffeid.SpiffeId
Represents a SPIFFE ID as defined in the SPIFFE standard.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic SpiffeIdfromSegments(@NonNull TrustDomain trustDomain, String... segments) Returns a new SPIFFE ID in the given trust domain with joined path segments.booleanmemberOf(TrustDomain trustDomain) Returns true if the trust domain of this SPIFFE ID is the same as trust domain given as parameter.static SpiffeIdParses a SPIFFE ID from a string (e.g.toString()Returns the string representation of the SPIFFE ID, concatenating schema, trust domain, and path segments (e.g.static voidvalidatePath(String path) Validates that a path string is a conformant path for a SPIFFE ID.
-
Method Details
-
fromSegments
Returns a new SPIFFE ID in the given trust domain with joined path segments. The path segments must be valid according to the SPIFFE specification and must not contain path separators. See https://github.com/spiffe/spiffe/blob/main/standards/SPIFFE-ID.md#22-path- Parameters:
trustDomain- an instance of aTrustDomainsegments- a list of string path segments- Returns:
- a
SpiffeId - Throws:
InvalidSpiffeIdException- if a given path segment contains an invalid char or empty or dot segment
-
parse
Parses a SPIFFE ID from a string (e.g. spiffe://example.org/test).- Parameters:
id- a String representing a SPIFFE ID- Returns:
- A
SpiffeId - Throws:
IllegalArgumentException- if the given string is emptyInvalidSpiffeIdException- if the given string id contain an invalid scheme, invalid char or empty or dot segment
-
memberOf
Returns true if the trust domain of this SPIFFE ID is the same as trust domain given as parameter.- Parameters:
trustDomain- an instance of aTrustDomain- Returns:
trueif the given trust domain equals the trust domain of this object,falseotherwise
-
toString
-
validatePath
Validates that a path string is a conformant path for a SPIFFE ID. See https://github.com/spiffe/spiffe/blob/main/standards/SPIFFE-ID.md#22-path
-