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.api; 019 020 import java.io.Serializable; 021 022 /** 023 * Options controlling how <code>org.cumulus4j.keymanager.DateDependentKeyStrategy.init(...)</code> 024 * should behave. 025 * 026 * @author Marco หงุ่ยตระกูล-Schulze - marco at nightlabs dot de 027 */ 028 public class DateDependentKeyStrategyInitParam 029 implements Serializable 030 { 031 private static final long serialVersionUID = 1L; 032 033 private long keyActivityPeriodMSec; 034 035 private long keyStorePeriodMSec; 036 037 /** 038 * Get the time (in millisec) how long each key should be valid. If < 1, the 039 * default value of 24 hours (= 86400000 msec) will be used. 040 * @return How long (in millisec) should each key be valid? A value < 1 means to use the default. 041 */ 042 public long getKeyActivityPeriodMSec() { 043 return keyActivityPeriodMSec; 044 } 045 /** 046 * @param keyActivityPeriodMSec how long (in millisec) should each key be valid. If < 1, the 047 * default value of 24 hours (= 86400000 msec) will be used. 048 */ 049 public void setKeyActivityPeriodMSec(long keyActivityPeriodMSec) { 050 this.keyActivityPeriodMSec = keyActivityPeriodMSec; 051 } 052 053 /** 054 * How long (in millisec) should the key store have fresh, unused keys? This number 055 * divided by the <code>keyActivityPeriodMSec</code> determines, how many keys must be generated. 056 * If < 1, the default value of 50 years (50 * 365 days - ignoring leap years!) will be used. 057 * @return How long (in millisec) should the key store have fresh, unused keys? 058 * A value < 1 means to use the default. 059 */ 060 public long getKeyStorePeriodMSec() { 061 return keyStorePeriodMSec; 062 } 063 /** 064 * @param keyStorePeriodMSec how long should the key store have fresh, unused keys. This number 065 * divided by the <code>keyActivityPeriodMSec</code> determines, how many keys must be generated. 066 * If < 1, the default value of 50 years (50 * 365 days - ignoring leap years!) will be used. 067 */ 068 public void setKeyStorePeriodMSec(long keyStorePeriodMSec) { 069 this.keyStorePeriodMSec = keyStorePeriodMSec; 070 } 071 }