Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
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;
 
This interface defines the methods that must be implemented by all based digital notaries.

Author(s):
Derk Norton
 
 public interface Notarization {

    
For a notary seal that expires after one minute.
 
     static public final int VALID_FOR_ONE_MINUTE = 60;

    
For a notary seal that expires after one hour.
 
     static public final int VALID_FOR_ONE_HOUR =  * 60;

    
For a notary seal that expires after one day.
 
     static public final int VALID_FOR_ONE_DAY =  * 24;

    
For a notary seal that expires after one week.
 
     static public final int VALID_FOR_ONE_WEEK =  * 7;

    
For a notary seal that expires after one month (30 days).
 
     static public final int VALID_FOR_ONE_MONTH =  * 30;

    
For a notary seal that expires after one year.
 
     static public final int VALID_FOR_ONE_YEAR =  * 365;

    
For a notary seal that never expires.
 
     static public final int VALID_FOR_FOREVER = .;

    
This method generates a new notary key consisting of an asymmetric (public/private) key pair based on the algorithm implemented by the specific notary implementation.

Returns:
The newly generated notary key.
 
     NotaryKey generateNotaryKey();

    
This method generates a watermark defining the lifetime of a new document as well as the version of the algorithm used to sign and verify the document.

Parameters:
secondsToLive The number of seconds the document should be valid from the current date and time.
Returns:
The newly generated watermark.
 
     Watermark generateWatermark(int secondsToLive);

    
This method checks to see if the watermark is still valid.

Parameters:
watermark The watermark to be validated.
Returns:
Whether or not the watermark is valid.
 
     boolean watermarkIsValid(Watermark watermark);

    
This method generates a digital seal from the specified document using the specified private notary key.

Parameters:
documentType The type of document being notarized.
document The document to be notarized.
notaryKey The notary key used to notarize the document.
Returns:
The newly generated digital seal.
 
     DigitalSeal notarizeDocument(String documentTypeString documentNotaryKey notaryKey);

    
This method uses the specified public verification key to verify that the specified digital seal is valid for the specified document.

Parameters:
document The notarized document to be verified.
seal The digital seal for the document.
verificationKey The verification key of the notary that signed the document.
Returns:
Whether or not the digital seal is valid.
    boolean documentIsValid(String documentDigitalSeal sealPublicKey verificationKey);

    
This method generates a digital seal from the specified document using the specified private notary key.

Parameters:
documentType The type of document being notarized.
document The document to be notarized.
notaryKey The notary key used to notarize the document.
Returns:
The newly generated digital seal.
    DigitalSeal notarizeDocument(String documentTypeSmartObject<? extends SmartObject<?>> documentNotaryKey notaryKey);

    
This method uses the specified public verification key to verify that the specified digital seal is valid for the specified document.

Parameters:
document The notarized document to be verified.
seal The digital seal for the document.
verificationKey The verification key of the notary that signed the document.
Returns:
Whether or not the digital seal is valid.
    boolean documentIsValid(SmartObject<? extends SmartObject<?>> documentDigitalSeal sealPublicKey verificationKey);
New to GrepCode? Check out our FAQ X