001 /* 002 * Cumulus4j - Securing your data in the cloud - http://cumulus4j.org 003 * Copyright (C) 2011 NightLabs Consulting GmbH 004 * 005 * This program is free software: you can redistribute it and/or modify 006 * it under the terms of the GNU Affero General Public License as 007 * published by the Free Software Foundation, either version 3 of the 008 * License, or (at your option) any later version. 009 * 010 * This program is distributed in the hope that it will be useful, 011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 013 * GNU Affero General Public License for more details. 014 * 015 * You should have received a copy of the GNU Affero General Public License 016 * along with this program. If not, see <http://www.gnu.org/licenses/>. 017 */ 018 package org.cumulus4j.keymanager.front.shared; 019 020 import java.io.Serializable; 021 022 import javax.xml.bind.annotation.XmlRootElement; 023 024 /** 025 * Options controlling how <code>org.cumulus4j.keymanager.DateDependentKeyStrategy.init(...)</code> 026 * should behave. 027 * @author Marco หงุ่ยตระกูล-Schulze - marco at nightlabs dot de 028 */ 029 @XmlRootElement 030 public class DateDependentKeyStrategyInitParam 031 implements Serializable 032 { 033 private static final long serialVersionUID = 1L; 034 035 private long keyActivityPeriodMSec; 036 037 private long keyStorePeriodMSec; 038 039 /** 040 * Get the time (in millisec) how long each key should be valid. If < 1, the 041 * default value of 24 hours (= 86400000 msec) will be used. 042 * @return How long (in millisec) should each key be valid? A value < 1 means to use the default. 043 */ 044 public long getKeyActivityPeriodMSec() { 045 return keyActivityPeriodMSec; 046 } 047 /** 048 * @param keyActivityPeriodMSec how long (in millisec) should each key be valid. If < 1, the 049 * default value of 24 hours (= 86400000 msec) will be used. 050 */ 051 public void setKeyActivityPeriodMSec(long keyActivityPeriodMSec) { 052 this.keyActivityPeriodMSec = keyActivityPeriodMSec; 053 } 054 055 /** 056 * How long (in millisec) should the key store have fresh, unused keys? This number 057 * divided by the <code>keyActivityPeriodMSec</code> determines, how many keys must be generated. 058 * If < 1, the default value of 50 years (50 * 365 days - ignoring leap years!) will be used. 059 * @return How long (in millisec) should the key store have fresh, unused keys? 060 * A value < 1 means to use the default. 061 */ 062 public long getKeyStorePeriodMSec() { 063 return keyStorePeriodMSec; 064 } 065 /** 066 * @param keyStorePeriodMSec how long should the key store have fresh, unused keys. This number 067 * divided by the <code>keyActivityPeriodMSec</code> determines, how many keys must be generated. 068 * If < 1, the default value of 50 years (50 * 365 days - ignoring leap years!) will be used. 069 */ 070 public void setKeyStorePeriodMSec(long keyStorePeriodMSec) { 071 this.keyStorePeriodMSec = keyStorePeriodMSec; 072 } 073 }