本文整理了Java中org.apache.kerby.kerberos.kerb.KrbCodec.encode()
方法的一些代码示例,展示了KrbCodec.encode()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。KrbCodec.encode()
方法的具体详情如下:
包路径:org.apache.kerby.kerberos.kerb.KrbCodec
类名称:KrbCodec
方法名:encode
KrbCodec.encode介绍
暂无
代码示例
代码示例来源:origin: org.apache.kerby/kerb-common
public static CheckSum seal(Asn1Encodeable asn1Object,
CheckSumType checkSumType) throws KrbException {
byte[] encoded = KrbCodec.encode(asn1Object);
CheckSum checksum = makeCheckSum(checkSumType, encoded);
return checksum;
}
代码示例来源:origin: apache/directory-kerby
public static CheckSum seal(Asn1Encodeable asn1Object,
CheckSumType checkSumType) throws KrbException {
byte[] encoded = KrbCodec.encode(asn1Object);
CheckSum checksum = makeCheckSum(checkSumType, encoded);
return checksum;
}
代码示例来源:origin: org.apache.kerby/kerb-common
public static EncryptedData seal(Asn1Encodeable asn1Type,
EncryptionKey key, KeyUsage usage) throws KrbException {
byte[] encoded = KrbCodec.encode(asn1Type);
return EncryptionHandler.encrypt(encoded, key, usage);
}
代码示例来源:origin: apache/directory-kerby
public static CheckSum seal(Asn1Encodeable asn1Object, CheckSumType checkSumType,
EncryptionKey key, KeyUsage usage) throws KrbException {
byte[] encoded = KrbCodec.encode(asn1Object);
CheckSum checksum = makeCheckSumWithKey(checkSumType, encoded, key, usage);
return checksum;
}
}
代码示例来源:origin: org.apache.kerby/kerb-common
public static CheckSum seal(Asn1Encodeable asn1Object, CheckSumType checkSumType,
EncryptionKey key, KeyUsage usage) throws KrbException {
byte[] encoded = KrbCodec.encode(asn1Object);
CheckSum checksum = makeCheckSumWithKey(checkSumType, encoded, key, usage);
return checksum;
}
}
代码示例来源:origin: apache/directory-kerby
public static EncryptedData seal(Asn1Encodeable asn1Type,
EncryptionKey key, KeyUsage usage) throws KrbException {
byte[] encoded = KrbCodec.encode(asn1Type);
return EncryptionHandler.encrypt(encoded, key, usage);
}
代码示例来源:origin: org.apache.kerby/json-backend
@Override
public JsonElement serialize(EncryptionKey encryptionKey,
Type type, JsonSerializationContext jsonSerializationContext) {
JsonObject jsOnObject= new JsonObject();
jsonObject.addProperty("kvno", encryptionKey.getKvno());
try {
jsonObject.addProperty("key", HexUtil.bytesToHex(KrbCodec.encode(encryptionKey)));
} catch (KrbException e) {
throw new RuntimeException(e);
}
return jsonObject;
}
}
代码示例来源:origin: apache/directory-kerby
@Override
public JsonElement serialize(EncryptionKey encryptionKey,
Type type, JsonSerializationContext jsonSerializationContext) {
JsonObject jsOnObject= new JsonObject();
jsonObject.addProperty("kvno", encryptionKey.getKvno());
try {
jsonObject.addProperty("key", HexUtil.bytesToHex(KrbCodec.encode(encryptionKey)));
} catch (KrbException e) {
throw new RuntimeException(e);
}
return jsonObject;
}
}
代码示例来源:origin: org.apache.kerby/kerb-client
private byte[] signAuthPack(AuthPack authPack) throws KrbException {
String oid = PkinitPlgCryptoContext.getIdPkinitAuthDataOID();
byte[] signedDataBytes = PkinitCrypto.eContentInfoCreate(
KrbCodec.encode(authPack), oid);
return signedDataBytes;
}
代码示例来源:origin: apache/directory-kerby
private byte[] signAuthPack(AuthPack authPack) throws KrbException {
String oid = PkinitPlgCryptoContext.getIdPkinitAuthDataOID();
byte[] signedDataBytes = PkinitCrypto.eContentInfoCreate(
KrbCodec.encode(authPack), oid);
return signedDataBytes;
}
代码示例来源:origin: apache/directory-kerby
public static byte[] eContentInfoCreate(byte[] data, String oid) throws KrbException {
EncapsulatedContentInfo eCOntentInfo= new EncapsulatedContentInfo();
eContentInfo.setContentType(oid);
eContentInfo.setContent(data);
return KrbCodec.encode(eContentInfo);
}
代码示例来源:origin: org.apache.kerby/kerb-common
public static byte[] eContentInfoCreate(byte[] data, String oid) throws KrbException {
EncapsulatedContentInfo eCOntentInfo= new EncapsulatedContentInfo();
eContentInfo.setContentType(oid);
eContentInfo.setContent(data);
return KrbCodec.encode(eContentInfo);
}
代码示例来源:origin: org.apache.kerby/kerb-client
/**
* Make padata entry.
*
* @param paPkAsReq The PaPkAsReq
* @return PaDataEntry to be made.
*/
private PaDataEntry makeEntry(PaPkAsReq paPkAsReq) throws KrbException {
PaDataEntry paDataEntry = new PaDataEntry();
paDataEntry.setPaDataType(PaDataType.PK_AS_REQ);
paDataEntry.setPaDataValue(KrbCodec.encode(paPkAsReq));
return paDataEntry;
}
}
代码示例来源:origin: apache/directory-kerby
/**
* Make padata entry.
*
* @param paPkAsReq The PaPkAsReq
* @return PaDataEntry to be made.
*/
private PaDataEntry makeEntry(PaPkAsReq paPkAsReq) throws KrbException {
PaDataEntry paDataEntry = new PaDataEntry();
paDataEntry.setPaDataType(PaDataType.PK_AS_REQ);
paDataEntry.setPaDataValue(KrbCodec.encode(paPkAsReq));
return paDataEntry;
}
}
代码示例来源:origin: org.apache.kerby/kerb-client
private KrbFastArmor fastArmorApRequest(EncryptionKey subKey, Credential credential)
throws KrbException {
KrbFastArmor fastArmor = new KrbFastArmor();
fastArmor.setArmorType(ArmorType.ARMOR_AP_REQUEST);
ApReq apReq = makeApReq(subKey, credential);
fastArmor.setArmorValue(KrbCodec.encode(apReq));
return fastArmor;
}
代码示例来源:origin: apache/directory-kerby
private KrbFastArmor fastArmorApRequest(EncryptionKey subKey, Credential credential)
throws KrbException {
KrbFastArmor fastArmor = new KrbFastArmor();
fastArmor.setArmorType(ArmorType.ARMOR_AP_REQUEST);
ApReq apReq = makeApReq(subKey, credential);
fastArmor.setArmorValue(KrbCodec.encode(apReq));
return fastArmor;
}
代码示例来源:origin: org.apache.kerby/kerb-client
/**
* Make padata entry.
*
* @param kdcRequest The kdc request
* @return PaDataEntry to be made.
*/
private PaDataEntry makeEntry(KdcRequest kdcRequest) throws KrbException {
TgsRequestWithTgt tgsRequest = (TgsRequestWithTgt) kdcRequest;
PaDataEntry paEntry = new PaDataEntry();
paEntry.setPaDataType(PaDataType.TGS_REQ);
paEntry.setPaDataValue(KrbCodec.encode(tgsRequest.getApReq()));
return paEntry;
}
}
代码示例来源:origin: apache/directory-kerby
/**
* Make padata entry.
*
* @param kdcRequest The kdc request
* @return PaDataEntry to be made.
*/
private PaDataEntry makeEntry(KdcRequest kdcRequest) throws KrbException {
TgsRequestWithTgt tgsRequest = (TgsRequestWithTgt) kdcRequest;
PaDataEntry paEntry = new PaDataEntry();
paEntry.setPaDataType(PaDataType.TGS_REQ);
paEntry.setPaDataValue(KrbCodec.encode(tgsRequest.getApReq()));
return paEntry;
}
}
代码示例来源:origin: apache/directory-kerby
public void process() throws KrbException {
KdcReq kdcReq = kdcRequest.getKdcReq();
KrbFastRequestState state = kdcRequest.getFastRequestState();
fastAsArmor(state, kdcRequest.getArmorKey(), subKey, credential, kdcReq);
kdcRequest.setFastRequestState(state);
kdcRequest.setOuterRequestBody(KrbCodec.encode(state.getFastOuterRequest().getReqBody()));
kdcReq.getPaData().addElement(makeFastEntry(state, kdcReq,
kdcRequest.getOuterRequestBody()));
}
代码示例来源:origin: org.apache.kerby/kerb-client
public void process() throws KrbException {
KdcReq kdcReq = kdcRequest.getKdcReq();
KrbFastRequestState state = kdcRequest.getFastRequestState();
fastAsArmor(state, kdcRequest.getArmorKey(), subKey, credential, kdcReq);
kdcRequest.setFastRequestState(state);
kdcRequest.setOuterRequestBody(KrbCodec.encode(state.getFastOuterRequest().getReqBody()));
kdcReq.getPaData().addElement(makeFastEntry(state, kdcReq,
kdcRequest.getOuterRequestBody()));
}