本文整理匯總了Java中org.bouncycastle.asn1.ASN1OctetString.getInstance方法的典型用法代碼示例。如果您正苦於以下問題:Java ASN1OctetString.getInstance方法的具體用法?Java ASN1OctetString.getInstance怎麽用?Java ASN1OctetString.getInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.bouncycastle.asn1.ASN1OctetString
的用法示例。
在下文中一共展示了ASN1OctetString.getInstance方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: CertResponse
import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
private CertResponse(ASN1Sequence seq)
{
certReqId = ASN1Integer.getInstance(seq.getObjectAt(0));
status = PKIStatusInfo.getInstance(seq.getObjectAt(1));
if (seq.size() >= 3)
{
if (seq.size() == 3)
{
ASN1Encodable o = seq.getObjectAt(2);
if (o instanceof ASN1OctetString)
{
rspInfo = ASN1OctetString.getInstance(o);
}
else
{
certifiedKeyPair = CertifiedKeyPair.getInstance(o);
}
}
else
{
certifiedKeyPair = CertifiedKeyPair.getInstance(seq.getObjectAt(2));
rspInfo = ASN1OctetString.getInstance(seq.getObjectAt(3));
}
}
}
示例2: BCGOST3410PrivateKey
import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
BCGOST3410PrivateKey(
PrivateKeyInfo info)
throws IOException
{
GOST3410PublicKeyAlgParameters params = new GOST3410PublicKeyAlgParameters((ASN1Sequence)info.getAlgorithmId().getParameters());
ASN1OctetString derX = ASN1OctetString.getInstance(info.parsePrivateKey());
byte[] keyEnc = derX.getOctets();
byte[] keyBytes = new byte[keyEnc.length];
for (int i = 0; i != keyEnc.length; i++)
{
keyBytes[i] = keyEnc[keyEnc.length - 1 - i]; // was little endian
}
this.x = new BigInteger(1, keyBytes);
this.gost3410Spec = GOST3410ParameterSpec.fromPublicKeyAlg(params);
}
示例3: PKIArchiveOptions
import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
private PKIArchiveOptions(ASN1TaggedObject tagged)
{
switch (tagged.getTagNo())
{
case encryptedPrivKey:
value = EncryptedKey.getInstance(tagged.getObject());
break;
case keyGenParameters:
value = ASN1OctetString.getInstance(tagged, false);
break;
case archiveRemGenPrivKey:
value = ASN1Boolean.getInstance(tagged, false);
break;
default:
throw new IllegalArgumentException("unknown tag number: " + tagged.getTagNo());
}
}
示例4: KeyTransRecipientInformation
import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
KeyTransRecipientInformation(
KeyTransRecipientInfo info,
AlgorithmIdentifier messageAlgorithm,
CMSSecureReadable secureReadable,
AuthAttributesProvider additionalData)
{
super(info.getKeyEncryptionAlgorithm(), messageAlgorithm, secureReadable, additionalData);
this.info = info;
RecipientIdentifier r = info.getRecipientIdentifier();
if (r.isTagged())
{
ASN1OctetString octs = ASN1OctetString.getInstance(r.getId());
rid = new KeyTransRecipientId(octs.getOctets());
}
else
{
IssuerAndSerialNumber iAnds = IssuerAndSerialNumber.getInstance(r.getId());
rid = new KeyTransRecipientId(iAnds.getName(), iAnds.getSerialNumber().getValue());
}
}
示例5: EncryptedContentInfo
import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
private EncryptedContentInfo(
ASN1Sequence seq)
{
if (seq.size() < 2)
{
throw new IllegalArgumentException("Truncated Sequence Found");
}
contentType = (ASN1ObjectIdentifier)seq.getObjectAt(0);
contentEncryptionAlgorithm = AlgorithmIdentifier.getInstance(
seq.getObjectAt(1));
if (seq.size() > 2)
{
encryptedContent = ASN1OctetString.getInstance(
(ASN1TaggedObject)seq.getObjectAt(2), false);
}
}
示例6: getInstance
import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
public static DSTU4145PublicKey getInstance(Object obj)
{
if (obj instanceof DSTU4145PublicKey)
{
return (DSTU4145PublicKey)obj;
}
if (obj != null)
{
return new DSTU4145PublicKey(ASN1OctetString.getInstance(obj));
}
return null;
}
示例7: getInstance
import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
public static SubjectKeyIdentifier getInstance(
Object obj)
{
if (obj instanceof SubjectKeyIdentifier)
{
return (SubjectKeyIdentifier)obj;
}
else if (obj != null)
{
return new SubjectKeyIdentifier(ASN1OctetString.getInstance(obj));
}
return null;
}
示例8: Challenge
import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
private Challenge(ASN1Sequence seq)
{
int index = 0;
if (seq.size() == 3)
{
owf = AlgorithmIdentifier.getInstance(seq.getObjectAt(index++));
}
witness = ASN1OctetString.getInstance(seq.getObjectAt(index++));
challenge = ASN1OctetString.getInstance(seq.getObjectAt(index));
}
示例9: EncryptedValue
import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
private EncryptedValue(ASN1Sequence seq)
{
int index = 0;
while (seq.getObjectAt(index) instanceof ASN1TaggedObject)
{
ASN1TaggedObject tObj = (ASN1TaggedObject)seq.getObjectAt(index);
switch (tObj.getTagNo())
{
case 0:
intendedAlg = AlgorithmIdentifier.getInstance(tObj, false);
break;
case 1:
symmAlg = AlgorithmIdentifier.getInstance(tObj, false);
break;
case 2:
encSymmKey = DERBitString.getInstance(tObj, false);
break;
case 3:
keyAlg = AlgorithmIdentifier.getInstance(tObj, false);
break;
case 4:
valueHint = ASN1OctetString.getInstance(tObj, false);
break;
}
index++;
}
encValue = DERBitString.getInstance(seq.getObjectAt(index));
}
示例10: ESSCertID
import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
/**
* constructor
*/
private ESSCertID(ASN1Sequence seq)
{
if (seq.size() < 1 || seq.size() > 2)
{
throw new IllegalArgumentException("Bad sequence size: " + seq.size());
}
certHash = ASN1OctetString.getInstance(seq.getObjectAt(0));
if (seq.size() > 1)
{
issuerSerial = IssuerSerial.getInstance(seq.getObjectAt(1));
}
}
示例11: getContent
import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
public ASN1OctetString getContent()
{
if (data.size() == 3)
{
ASN1TaggedObject o = ASN1TaggedObject.getInstance(data.getObjectAt(2));
return ASN1OctetString.getInstance(o, false);
}
return null;
}
示例12: SignerInformation
import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
SignerInformation(
SignerInfo info,
ASN1ObjectIdentifier contentType,
CMSProcessable content,
byte[] resultDigest)
{
this.info = info;
this.contentType = contentType;
this.isCounterSignature = contentType == null;
SignerIdentifier s = info.getSID();
if (s.isTagged())
{
ASN1OctetString octs = ASN1OctetString.getInstance(s.getId());
sid = new SignerId(octs.getOctets());
}
else
{
IssuerAndSerialNumber iAnds = IssuerAndSerialNumber.getInstance(s.getId());
sid = new SignerId(iAnds.getName(), iAnds.getSerialNumber().getValue());
}
this.digestAlgorithm = info.getDigestAlgorithm();
this.signedAttributeSet = info.getAuthenticatedAttributes();
this.unsignedAttributeSet = info.getUnauthenticatedAttributes();
this.encryptionAlgorithm = info.getDigestEncryptionAlgorithm();
this.signature = info.getEncryptedDigest().getOctets();
this.content = content;
this.resultDigest = resultDigest;
}
示例13: getMac
import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
public ASN1OctetString getMac()
throws IOException
{
if (nextObject == null)
{
nextObject = seq.readObject();
}
ASN1Encodable o = nextObject;
nextObject = null;
return ASN1OctetString.getInstance(o.toASN1Primitive());
}
示例14: CertStatus
import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
private CertStatus(ASN1Sequence seq)
{
certHash = ASN1OctetString.getInstance(seq.getObjectAt(0));
certReqId = ASN1Integer.getInstance(seq.getObjectAt(1));
if (seq.size() > 2)
{
statusInfo = PKIStatusInfo.getInstance(seq.getObjectAt(2));
}
}
示例15: getId
import org.bouncycastle.asn1.ASN1OctetString; //導入方法依賴的package包/類
public ASN1Encodable getId()
{
if (id instanceof ASN1TaggedObject)
{
return ASN1OctetString.getInstance((ASN1TaggedObject)id, false);
}
return id;
}