All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.yahoo.vespa.security.tool.crypto.EncryptTool Maven / Gradle / Ivy

There is a newer version: 8.441.21
Show newest version
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.security.tool.crypto;

import com.yahoo.security.KeyId;
import com.yahoo.security.KeyUtils;
import com.yahoo.security.SharedKeyGenerator;
import com.yahoo.vespa.security.tool.CliUtils;
import com.yahoo.vespa.security.tool.Tool;
import com.yahoo.vespa.security.tool.ToolDescription;
import com.yahoo.vespa.security.tool.ToolInvocation;
import org.apache.commons.cli.Option;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;

/**
 * Tooling to encrypt a file using a public key, emitting a non-secret token that can be
 * passed on to a recipient holding the corresponding private key.
 *
 * Uses the opaque token abstraction from {@link SharedKeyGenerator}.
 *
 * @author vekterli
 */
public class EncryptTool implements Tool {

    static final String OUTPUT_FILE_OPTION          = "output-file";
    static final String KEY_ID_OPTION               = "key-id";
    static final String RECIPIENT_PUBLIC_KEY_OPTION = "recipient-public-key";
    static final String ZSTD_COMPRESS_OPTION        = "zstd-compress";

    private static final List




© 2015 - 2024 Weber Informatics LLC | Privacy Policy