当前位置: 首页>>代码示例>>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;未经允许,请勿转载。