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

nl.martijndwars.webpush.Encrypted Maven / Gradle / Ivy

There is a newer version: 5.1.2
Show newest version
package nl.martijndwars.webpush;

import java.security.PublicKey;

public class Encrypted {
    private final PublicKey publicKey;
    private final byte[] salt;
    private final byte[] ciphertext;

    public Encrypted(final PublicKey publicKey, final byte[] salt, final byte[] ciphertext) {
        this.publicKey = publicKey;
        this.salt = salt;
        this.ciphertext = ciphertext;
    }

    public PublicKey getPublicKey() {
        return publicKey;
    }

    public byte[] getSalt() {
        return salt;
    }

    public byte[] getCiphertext() {
        return ciphertext;
    }

    public static class Builder {
        private PublicKey publicKey;
        private byte[] salt;
        private byte[] ciphertext;

        public Builder withPublicKey(PublicKey publicKey) {
            this.publicKey = publicKey;

            return this;
        }

        public Builder withSalt(byte[] salt) {
            this.salt = salt;

            return this;
        }

        public Builder withCiphertext(byte[] ciphertext) {
            this.ciphertext = ciphertext;

            return this;
        }

        public Encrypted build() {
            return new Encrypted(publicKey, salt, ciphertext);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy