dev.fitko.fitconnect.api.services.keys.KeyService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of client Show documentation
Show all versions of client Show documentation
Library that provides client access to the FIT-Connect api-endpoints for sending, subscribing and
routing
package dev.fitko.fitconnect.api.services.keys;
import com.nimbusds.jose.jwk.KeyOperation;
import com.nimbusds.jose.jwk.RSAKey;
import dev.fitko.fitconnect.api.domain.model.destination.Destination;
import dev.fitko.fitconnect.api.services.validation.ValidationService;
import java.util.UUID;
/**
* Service to retrieve and validate public keys from a {@link Destination} or the submission service well-known keys.
*
* @see ValidationService
*/
public interface KeyService {
/**
* Get the public encryption key for a given destination.
*
* @param destination the {@link Destination} the key is requested from
* @return validated {@link RSAKey} (@see {@link ValidationService#validatePublicKey(RSAKey, KeyOperation)}})
*/
RSAKey getPublicEncryptionKey(Destination destination);
/**
* Get the public signature key for a given destination.
*
* @param destinationId unique identifier of the {@link Destination}
* @param keyId unique identifier of the {@link RSAKey}
* @return validated {@link RSAKey} (@see {@link ValidationService#validatePublicKey(RSAKey, KeyOperation)}})
*/
RSAKey getPublicSignatureKey(UUID destinationId, String keyId);
/**
* Get a public signature key for a given key-id from the self-service portal well-known keys.
*
* @param keyId unique identifier of the {@link RSAKey}
* @return validated {@link RSAKey} (@see {@link ValidationService#validatePublicKey(RSAKey, KeyOperation)}})
*/
RSAKey getPortalPublicKey(String keyId);
/**
* Get a public signature key for a given key-id from the submission service well-known keys.
*
* @param keyId unique identifier of the {@link RSAKey}
* @return validated {@link RSAKey} (@see {@link ValidationService#validatePublicKey(RSAKey, KeyOperation)}})
*/
RSAKey getSubmissionServicePublicKey(String keyId);
/**
* Get a public signature key for a given key-id from a submission service instance url well known keys.
* The '/well-known/jkws.json' is added to the given url.
*
* @param url custom url to load the well known keys from
* @param keyId unique identifier of the {@link RSAKey} the well known keys are filtered by
* @return validated {@link RSAKey} (@see {@link ValidationService#validatePublicKey(RSAKey, KeyOperation)}})
*/
RSAKey getWellKnownKeysForSubmissionUrl(String url, String keyId);
}