public EncryptionKey(int keyType, byte[] keyData, int kvno) { this(EncryptionType.fromValue(keyType), keyData, kvno); }
public EncryptionKey(int keyType, byte[] keyData, int kvno) { this(EncryptionType.fromValue(keyType), keyData, kvno); }
/** * Get the encryption handler. * * @param eType The encryption type int * @return The EncTypeHandler * @throws KrbException e */ public static EncTypeHandler getEncHandler(int eType) throws KrbException { EncryptionType eTypeEnum = EncryptionType.fromValue(eType); return getEncHandler(eTypeEnum); }
/** * @return The {@link EncryptionType} of this instance */ public EncryptionType getEType() { Integer value = getFieldAsInteger(EncryptedDataField.ETYPE); return EncryptionType.fromValue(value); }
public EncryptionType getKeyType() { Integer value = getFieldAsInteger(EncryptionKeyField.KEY_TYPE); return EncryptionType.fromValue(value); }
/** * @return The {@link EncryptionType} of this instance */ public EncryptionType getEType() { Integer value = getFieldAsInteger(EncryptedDataField.ETYPE); return EncryptionType.fromValue(value); }
public EncryptionType getEtype() { return EncryptionType.fromValue(getFieldAsInt(EtypeInfoEntryField.ETYPE)); }
/** * Get the encryption handler. * * @param eType The encryption type int * @return The EncTypeHandler * @throws KrbException e */ public static EncTypeHandler getEncHandler(int eType) throws KrbException { EncryptionType eTypeEnum = EncryptionType.fromValue(eType); return getEncHandler(eTypeEnum); }
public EncryptionType getKeyType() { Integer value = getFieldAsInteger(EncryptionKeyField.KEY_TYPE); return EncryptionType.fromValue(value); }
public EncryptionType getEtype() { return EncryptionType.fromValue(getFieldAsInt(EtypeInfoEntryField.ETYPE)); }
public EncryptionType getEtype() { return EncryptionType.fromValue(getFieldAsInt(EtypeInfo2EntryField.ETYPE)); }
public EncryptionType getEtype() { return EncryptionType.fromValue(getFieldAsInt(EtypeInfo2EntryField.ETYPE)); }
public List<EncryptionType> getEtypes() { KrbIntegers values = getFieldAs(KdcReqBodyField.ETYPE, KrbIntegers.class); if (values == null) { return Collections.emptyList(); } List<EncryptionType> results = new ArrayList<>(); for (Integer value : values.getValues()) { results.add(EncryptionType.fromValue(value)); } return results; }
public List<EncryptionType> getEtypes() { KrbIntegers values = getFieldAs(KdcReqBodyField.ETYPE, KrbIntegers.class); if (values == null) { return Collections.emptyList(); } List<EncryptionType> results = new ArrayList<>(); for (Integer value : values.getValues()) { results.add(EncryptionType.fromValue(value)); } return results; }
public EncryptionKey readKey() throws IOException { int eType = readShort(); EncryptionType encType = EncryptionType.fromValue(eType); byte[] keyData = readCountedOctets(); if (encType == EncryptionType.NONE || keyData == null) { return null; } EncryptionKey key = new EncryptionKey(encType, keyData); return key; }
public EncryptionKey readKey() throws IOException { int eType = readShort(); EncryptionType encType = EncryptionType.fromValue(eType); byte[] keyData = readCountedOctets(); if (encType == EncryptionType.NONE || keyData == null) { return null; } EncryptionKey key = new EncryptionKey(encType, keyData); return key; }
protected void testGet(IdentityBackend backend) throws KrbException { KrbIdentity kid = BackendTestUtil.createOneIdentity(TEST_PRINCIPAL); backend.addIdentity(kid); // clear the identity cache. backend.release(); KrbIdentity identity = backend.getIdentity(TEST_PRINCIPAL); assertThat(identity).isNotNull(); assertThat(identity.getExpireTime()).isEqualTo(kid.getExpireTime()); assertThat(identity.isDisabled()).isEqualTo(kid.isDisabled()); assertThat(identity.getKeyVersion()).isEqualTo(kid.getKeyVersion()); for (EncryptionKey expectedKey : kid.getKeys().values()) { EncryptionType actualType = EncryptionType.fromValue(expectedKey.getKeyType().getValue()); EncryptionKey actualKey = identity.getKey(actualType); assertThat(actualKey.getKeyType().getValue()).isEqualTo(expectedKey.getKeyType().getValue()); assertThat(actualKey.getKeyData()).isEqualTo(expectedKey.getKeyData()); assertThat(actualKey.getKvno()).isEqualTo(expectedKey.getKvno()); } //tearDown backend.deleteIdentity(TEST_PRINCIPAL); }
protected void testGet(IdentityBackend backend) throws KrbException { KrbIdentity kid = BackendTestUtil.createOneIdentity(TEST_PRINCIPAL); backend.addIdentity(kid); // clear the identity cache. backend.release(); KrbIdentity identity = backend.getIdentity(TEST_PRINCIPAL); assertThat(identity).isNotNull(); assertThat(identity.getExpireTime()).isEqualTo(kid.getExpireTime()); assertThat(identity.isDisabled()).isEqualTo(kid.isDisabled()); assertThat(identity.getKeyVersion()).isEqualTo(kid.getKeyVersion()); for (EncryptionKey expectedKey : kid.getKeys().values()) { EncryptionType actualType = EncryptionType.fromValue(expectedKey.getKeyType().getValue()); EncryptionKey actualKey = identity.getKey(actualType); assertThat(actualKey.getKeyType().getValue()).isEqualTo(expectedKey.getKeyType().getValue()); assertThat(actualKey.getKeyData()).isEqualTo(expectedKey.getKeyData()); assertThat(actualKey.getKvno()).isEqualTo(expectedKey.getKvno()); } //tearDown backend.deleteIdentity(TEST_PRINCIPAL); }