craterdog.security.SealAttributes Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-digital-notary-api Show documentation
Show all versions of java-digital-notary-api Show documentation
This project defines the Java interfaces and classes supported by a digital notary.
/************************************************************************
* Copyright (c) Crater Dog Technologies(TM). All Rights Reserved. *
************************************************************************
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. *
* *
* This code is free software; you can redistribute it and/or modify it *
* under the terms of The MIT License (MIT), as published by the Open *
* Source Initiative. (See http://opensource.org/licenses/MIT) *
************************************************************************/
package craterdog.security;
import craterdog.primitives.Tag;
import craterdog.smart.SmartObject;
import org.joda.time.DateTime;
/**
* This class defines the attributes that make up a digital seal that is used to sign
* a document.
*
* @author Derk Norton
*/
public final class SealAttributes extends SmartObject {
/**
* The unique identifier for the notary key that was used to generate the signature.
*/
public Tag notaryKeyId;
/**
* A base 32 encoding of the SHA256 hash of the byte encoding for the public verification key
* associated with the signing key used to generate the signature.
*/
public String sha256VerificationKeyHash;
/**
* The date and time that the document was notarized.
*/
public DateTime timestamp;
/**
* The type of document that this seal notarizes.
*/
public String documentType;
/**
* A base 32 encoding of the bytes that were generated as a signature of the document. The
* signature must be generated using the following steps:
*
* - Format the document as a string.
* - Extract the characters of the string into a "UTF-8" based byte array.
* - Generate the signature bytes for that array using the algorithm specified in the
Watermark
.
* - Encode the signature bytes as a base 32 string using the craterdog.utils.Base32Utils class.
*
*/
public String documentSignature;
/**
* The default constructor ensures that the custom attribute types (like tags) will be
* formatted correctly when printed.
*/
public SealAttributes() {
this.addSerializableClass(Tag.class);
}
}