
org.eclipse.edc.identityhub.spi.participantcontext.ParticipantContextId Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of participant-context-spi Show documentation
Show all versions of participant-context-spi Show documentation
edc :: participant-context-spi
/*
* Copyright (c) 2024 Metaform Systems, Inc.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
*
* Contributors:
* Metaform Systems, Inc. - initial API and implementation
*
*/
package org.eclipse.edc.identityhub.spi.participantcontext;
import org.eclipse.edc.spi.result.Result;
import java.nio.charset.StandardCharsets;
import java.util.Base64;
public class ParticipantContextId {
private ParticipantContextId() {
}
/**
* Decode a base64-url encoded participantId.
*
* @param encoded base64-url encoded participantId.
* @return human-readable participantId.
*/
public static Result onEncoded(String encoded) {
var bytes = Base64.getUrlDecoder().decode(encoded.getBytes());
return Result.success(new String(bytes, StandardCharsets.UTF_8));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy