Search in sources :

Example 1 with GpgKeysInput

use of com.google.gerrit.extensions.api.accounts.GpgKeysInput in project gerrit by GerritCodeReview.

the class GpgApiAdapterImpl method putGpgKeys.

@Override
public Map<String, GpgKeyInfo> putGpgKeys(AccountResource account, List<String> add, List<String> delete) throws RestApiException, GpgException {
    GpgKeysInput in = new GpgKeysInput();
    in.add = add;
    in.delete = delete;
    try {
        return postGpgKeys.get().apply(account, in).value();
    } catch (PGPException | IOException | ConfigInvalidException e) {
        throw new GpgException(e);
    } catch (Exception e) {
        throw asRestApiException("Cannot put GPG keys", e);
    }
}
Also used : PGPException(org.bouncycastle.openpgp.PGPException) GpgException(com.google.gerrit.server.GpgException) GpgKeysInput(com.google.gerrit.extensions.api.accounts.GpgKeysInput) ConfigInvalidException(org.eclipse.jgit.errors.ConfigInvalidException) IOException(java.io.IOException) ApiUtil.asRestApiException(com.google.gerrit.server.api.ApiUtil.asRestApiException) ConfigInvalidException(org.eclipse.jgit.errors.ConfigInvalidException) IOException(java.io.IOException) GpgException(com.google.gerrit.server.GpgException) RestApiException(com.google.gerrit.extensions.restapi.RestApiException) PGPException(org.bouncycastle.openpgp.PGPException)

Aggregations

GpgKeysInput (com.google.gerrit.extensions.api.accounts.GpgKeysInput)1 RestApiException (com.google.gerrit.extensions.restapi.RestApiException)1 GpgException (com.google.gerrit.server.GpgException)1 ApiUtil.asRestApiException (com.google.gerrit.server.api.ApiUtil.asRestApiException)1 IOException (java.io.IOException)1 PGPException (org.bouncycastle.openpgp.PGPException)1 ConfigInvalidException (org.eclipse.jgit.errors.ConfigInvalidException)1