com.pdftools.crypto.providers.swisscomsigsrv.TimestampConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pdftools-sdk Show documentation
Show all versions of pdftools-sdk Show documentation
The Pdftools SDK is a comprehensive development library that lets developers integrate advanced PDF functionalities into in-house applications.
The newest version!
/****************************************************************************
*
* File: TimestampConfiguration.java
*
* Description: PDFTOOLS TimestampConfiguration Class
*
* Author: PDF Tools AG
*
* Copyright: Copyright (C) 2023 - 2024 PDF Tools AG, Switzerland
* All rights reserved.
*
* Notice: By downloading and using this artifact, you accept PDF Tools AG's
* [license agreement](https://www.pdf-tools.com/license-agreement/),
* [privacy policy](https://www.pdf-tools.com/privacy-policy/),
* and allow PDF Tools AG to track your usage data.
*
***************************************************************************/
package com.pdftools.crypto.providers.swisscomsigsrv;
import com.pdftools.sys.*;
import com.pdftools.internal.*;
import java.util.EnumSet;
import java.time.OffsetDateTime;
/**
* The time-stamp configuration
*/
public class TimestampConfiguration extends com.pdftools.sign.TimestampConfiguration
{
protected TimestampConfiguration(long handle)
{
super(handle);
}
/**
* @hidden
*/
public static TimestampConfiguration createDynamicObject(long handle)
{
return new TimestampConfiguration(handle);
}
/**
* The message digest algorithm (Getter)
*
* The algorithm used to hash the document and from which the cryptographic signature is created.
*
* Default: {@link com.pdftools.crypto.HashAlgorithm#SHA256 pdftools.crypto.HashAlgorithm.SHA256}
*/
public com.pdftools.crypto.HashAlgorithm getHashAlgorithm()
{
int retVal = getHashAlgorithmNative(getHandle());
if (retVal == 0)
{
switch (getLastErrorCode())
{
case 0: break;
default: throwLastRuntimeException();
}
}
return com.pdftools.crypto.HashAlgorithm.fromValue(retVal);
}
/**
* The message digest algorithm (Setter)
*
* The algorithm used to hash the document and from which the cryptographic signature is created.
*
* Default: {@link com.pdftools.crypto.HashAlgorithm#SHA256 pdftools.crypto.HashAlgorithm.SHA256}
*
* @throws IllegalArgumentException If the value is invalid or not supported.
* @throws IllegalArgumentException if {@code value} is {@code null}
*/
public void setHashAlgorithm(com.pdftools.crypto.HashAlgorithm value)
{
if (value == null)
throw new IllegalArgumentException("Argument 'value' must not be null.", new NullPointerException("'value'"));
boolean retVal = setHashAlgorithmNative(getHandle(), value.getValue());
if (!retVal)
{
switch (getLastErrorCode())
{
case 0: throw new RuntimeException("An unexpected error occurred");
case 3: throw new IllegalArgumentException(getLastErrorMessage());
default: throwLastRuntimeException();
}
}
}
private native int getHashAlgorithmNative(long handle);
private native boolean setHashAlgorithmNative(long handle, int value);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy