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

org.odftoolkit.odfdom.pkg.manifest.EncryptionDataElement Maven / Gradle / Ivy

Go to download

ODFDOM is an OpenDocument Format (ODF) framework. Its purpose is to provide an easy common way to create, access and manipulate ODF files, without requiring detailed knowledge of the ODF specification. It is designed to provide the ODF developer community with an easy lightwork programming API portable to any object-oriented language. The current reference implementation is written in Java.

There is a newer version: 0.8.11-incubating
Show newest version
/************************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
 * 
 * Use is subject to license terms.
 * 
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 ************************************************************************/

/*
 * This file is automatically generated.
 * Don't edit manually.
 */
package org.odftoolkit.odfdom.pkg.manifest;

import org.odftoolkit.odfdom.pkg.OdfElement;
import org.odftoolkit.odfdom.pkg.OdfFileDom;
import org.odftoolkit.odfdom.pkg.OdfName;
/**
 * Manifest implementation of OpenDocument element  {@odf.element manifest:encryption-data}.
 *
 */
public class EncryptionDataElement extends OdfElement {

	public static final OdfName ELEMENT_NAME = OdfName.newName("urn:oasis:names:tc:opendocument:xmlns:manifest:1.0", "manifest:encryption-data");

	/**
	 * Create the instance of EncryptionDataElement
	 *
	 * @param  ownerDoc  The type is OdfFileDom
	 */
	public EncryptionDataElement(OdfFileDom ownerDoc) {
		super(ownerDoc, ELEMENT_NAME);
	}

	/**
	 * Get the element name
	 *
	 * @return  return   OdfName the name of element {@odf.element manifest:encryption-data}.
	 */
	public OdfName getOdfName() {
		return ELEMENT_NAME;
	}

	/**
	 * Receives the value of the ODFDOM attribute representation ChecksumAttribute , See {@odf.attribute manifest:checksum}
	 *
	 * Attribute is mandatory.
	 *
	 * @return - the String , the value or null, if the attribute is not set and no default value defined.
	 */
	public String getChecksumAttribute() {
		ChecksumAttribute attr = (ChecksumAttribute) getOdfAttribute(ChecksumAttribute.ATTRIBUTE_NAME);
		if (attr != null) {
			return String.valueOf(attr.getValue());
		}
		return null;
	}

	/**
	 * Sets the value of ODFDOM attribute representation ChecksumAttribute , See {@odf.attribute manifest:checksum}
	 *
	 * @param checksumValue   The type is String
	 */
	public void setChecksumAttribute(String checksumValue) {
		ChecksumAttribute attr = new ChecksumAttribute((OdfFileDom) this.ownerDocument);
		setOdfAttribute(attr);
		attr.setValue(checksumValue);
	}

	/**
	 * Receives the value of the ODFDOM attribute representation ChecksumTypeAttribute , See {@odf.attribute manifest:checksum-type}
	 *
	 * Attribute is mandatory.
	 *
	 * @return - the String , the value or null, if the attribute is not set and no default value defined.
	 */
	public String getChecksumTypeAttribute() {
		ChecksumTypeAttribute attr = (ChecksumTypeAttribute) getOdfAttribute(ChecksumTypeAttribute.ATTRIBUTE_NAME);
		if (attr != null) {
			return String.valueOf(attr.getValue());
		}
		return null;
	}

	/**
	 * Sets the value of ODFDOM attribute representation ChecksumTypeAttribute , See {@odf.attribute manifest:checksum-type}
	 *
	 * @param checksumTypeValue   The type is String
	 */
	public void setChecksumTypeAttribute(String checksumTypeValue) {
		ChecksumTypeAttribute attr = new ChecksumTypeAttribute((OdfFileDom) this.ownerDocument);
		setOdfAttribute(attr);
		attr.setValue(checksumTypeValue);
	}

	/**
	 * Create child element {@odf.element manifest:algorithm}.
	 *
	 * @param algorithmNameValue  the String value of AlgorithmNameAttribute, see {@odf.attribute  manifest:algorithm-name} at specification
	 * @param initialisationVectorValue  the String value of InitialisationVectorAttribute, see {@odf.attribute  manifest:initialisation-vector} at specification
	 * Child element is new in Odf 1.2
	 *
	 * Child element is mandatory.
	 *
	 * @return the element {@odf.element manifest:algorithm}
	 */
	 public AlgorithmElement newAlgorithmElement(String algorithmNameValue, String initialisationVectorValue) {
		AlgorithmElement algorithm = ((OdfFileDom) this.ownerDocument).newOdfElement(AlgorithmElement.class);
		algorithm.setAlgorithmNameAttribute(algorithmNameValue);
		algorithm.setInitialisationVectorAttribute(initialisationVectorValue);
		this.appendChild(algorithm);
		return algorithm;
	}

	/**
	 * Create child element {@odf.element manifest:key-derivation}.
	 *
	 * @param iterationCountValue  the Integer value of IterationCountAttribute, see {@odf.attribute  manifest:iteration-count} at specification
	 * @param keyDerivationNameValue  the String value of KeyDerivationNameAttribute, see {@odf.attribute  manifest:key-derivation-name} at specification
	 * @param saltValue  the String value of SaltAttribute, see {@odf.attribute  manifest:salt} at specification
	 * Child element is new in Odf 1.2
	 *
	 * Child element is mandatory.
	 *
	 * @return the element {@odf.element manifest:key-derivation}
	 */
	 public KeyDerivationElement newKeyDerivationElement(int iterationCountValue, String keyDerivationNameValue, String saltValue) {
		KeyDerivationElement keyDerivation = ((OdfFileDom) this.ownerDocument).newOdfElement(KeyDerivationElement.class);
		keyDerivation.setIterationCountAttribute(iterationCountValue);
		keyDerivation.setKeyDerivationNameAttribute(keyDerivationNameValue);
		keyDerivation.setSaltAttribute(saltValue);
		this.appendChild(keyDerivation);
		return keyDerivation;
	}

	/**
	 * Create child element {@odf.element manifest:start-key-generation}.
	 *
	 * @param startKeyGenerationNameValue  the String value of StartKeyGenerationNameAttribute, see {@odf.attribute  manifest:start-key-generation-name} at specification
	 * Child element is new in Odf 1.2
	 *
	 * @return the element {@odf.element manifest:start-key-generation}
	 */
	 public StartKeyGenerationElement newStartKeyGenerationElement(String startKeyGenerationNameValue) {
		StartKeyGenerationElement startKeyGeneration = ((OdfFileDom) this.ownerDocument).newOdfElement(StartKeyGenerationElement.class);
		startKeyGeneration.setStartKeyGenerationNameAttribute(startKeyGenerationNameValue);
		this.appendChild(startKeyGeneration);
		return startKeyGeneration;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy