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

com.lacunasoftware.restpkicore.DigestAlgorithmAndValue Maven / Gradle / Ivy

There is a newer version: 1.1.4
Show newest version
package com.lacunasoftware.restpkicore;

/**
 * Represents a digest algorithm and value.
 */
public class DigestAlgorithmAndValue {

	private DigestAlgorithm algorithm;
	private byte[] value;

	DigestAlgorithmAndValue(DigestAlgorithmAndValueModel model) {
		this.algorithm = DigestAlgorithm.getInstanceByApiModel(model.getAlgorithm());
		this.value = model.getValue();
	}

	/**
	 * Returns the digest algorithm.
	 */
	public DigestAlgorithm getAlgorithm() {
		return algorithm;
	}

	public void setAlgorithm(DigestAlgorithm algorithm) {
		this.algorithm = algorithm;
	}

	/**
	 * Returns the digest value.
	 */
	public byte[] getValue() {
		return value;
	}

	public void setValue(byte[] value) {
		this.value = value;
	}

    public String getValueAsBase64() {
        return Util.encodeBase64(value);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy