當前位置: 首頁>>代碼示例>>Java>>正文


Java KeyStatus類代碼示例

本文整理匯總了Java中org.keyczar.enums.KeyStatus的典型用法代碼示例。如果您正苦於以下問題:Java KeyStatus類的具體用法?Java KeyStatus怎麽用?Java KeyStatus使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


KeyStatus類屬於org.keyczar.enums包,在下文中一共展示了KeyStatus類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: ImportedKeyReader

import org.keyczar.enums.KeyStatus; //導入依賴的package包/類
public ImportedKeyReader(AesKey paramAesKey)
{
  KeyVersion localKeyVersion = new KeyVersion(KeyStatus.PRIMARY);
  this.metadata.addVersion(localKeyVersion);
  this.keys = new ArrayList();
  this.keys.add(paramAesKey);
}
 
開發者ID:ChiangC,項目名稱:FMTech,代碼行數:8,代碼來源:ImportedKeyReader.java

示例2: Keyczar

import org.keyczar.enums.KeyStatus; //導入依賴的package包/類
public Keyczar(KeyczarReader paramKeyczarReader)
  throws KeyczarException
{
  this.kmd = KeyMetadata.read(paramKeyczarReader.getMetadata());
  if (!isAcceptablePurpose(this.kmd.purpose))
  {
    Object[] arrayOfObject = new Object[1];
    arrayOfObject[0] = this.kmd.purpose;
    throw new KeyczarException(Messages.getString("Keyczar.UnacceptablePurpose", arrayOfObject));
  }
  if ((this.kmd.encrypted) && (!(paramKeyczarReader instanceof EncryptedReader))) {
    throw new KeyczarException(Messages.getString("Keyczar.NeedEncryptedReader", new Object[0]));
  }
  Iterator localIterator = this.kmd.versions.iterator();
  while (localIterator.hasNext())
  {
    KeyVersion localKeyVersion = (KeyVersion)localIterator.next();
    if (localKeyVersion.status == KeyStatus.PRIMARY)
    {
      if (this.primaryVersion != null) {
        throw new KeyczarException(Messages.getString("Keyczar.SinglePrimary", new Object[0]));
      }
      this.primaryVersion = localKeyVersion;
    }
    KeyType localKeyType = this.kmd.type;
    String str = paramKeyczarReader.getKey(localKeyVersion.versionNumber);
    KeyczarKey localKeyczarKey = localKeyType.getBuilder().read(str);
    LOG.debug(Messages.getString("Keyczar.ReadVersion", new Object[] { localKeyVersion }));
    this.hashMap.put(new KeyHash(localKeyczarKey.hash(), (byte)0), localKeyczarKey);
    this.versionMap.put(localKeyVersion, localKeyczarKey);
  }
}
 
開發者ID:ChiangC,項目名稱:FMTech,代碼行數:33,代碼來源:Keyczar.java

示例3: createKey

import org.keyczar.enums.KeyStatus; //導入依賴的package包/類
/** Returns a GenericKeyczar containing a new generated key of type. */
public static GenericKeyczar createKey(DefaultKeyType type, KeyPurpose purpose, int size)
		throws KeyczarException {
	KeyMetadata metadata = new KeyMetadata("Key", purpose, type);
	KeyczarReader reader = new MemoryKeyReader(metadata, null);
	GenericKeyczar keyczar = new GenericKeyczar(reader);
	keyczar.addVersion(KeyStatus.PRIMARY, size);
	return keyczar;
}
 
開發者ID:WeAreWizards,項目名稱:passopolis-server,代碼行數:10,代碼來源:Util.java

示例4: StaticKeyReader

import org.keyczar.enums.KeyStatus; //導入依賴的package包/類
StaticKeyReader(AesKey key) {
  this.metadata = new KeyMetadata(
          "Imported AES", KeyPurpose.DECRYPT_AND_ENCRYPT, DefaultKeyType.AES);
  KeyVersion version = new KeyVersion(0, KeyStatus.PRIMARY, false);
  this.metadata.addVersion(version);
  this.keys = new ArrayList<KeyczarKey>();
  this.keys.add(key);
}
 
開發者ID:WeAreWizards,項目名稱:passopolis-server,代碼行數:9,代碼來源:JsonWriterTest.java

示例5: KeyVersion

import org.keyczar.enums.KeyStatus; //導入依賴的package包/類
public KeyVersion(KeyStatus paramKeyStatus)
{
  this.versionNumber = 0;
  this.status = paramKeyStatus;
  this.exportable = false;
}
 
開發者ID:ChiangC,項目名稱:FMTech,代碼行數:7,代碼來源:KeyVersion.java


注:本文中的org.keyczar.enums.KeyStatus類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。