![JAR search and dependency download from the Maven repository](/logo.png)
org.bouncycastle.asn1.BERSequence Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bc-fips-debug Show documentation
Show all versions of bc-fips-debug Show documentation
The FIPS 140-2 Bouncy Castle Crypto package is a Java implementation of cryptographic algorithms certified to FIPS 140-2 level 1. This jar contains the debug version JCE provider and low-level API for the BC-FJA version 1.0.2.3, FIPS Certificate #3514. Please note the debug jar is not certified.
/***************************************************************/
/****** DO NOT EDIT THIS CLASS bc-java SOURCE FILE ******/
/***************************************************************/
package org.bouncycastle.asn1;
import java.io.IOException;
/**
* Indefinite length SEQUENCE of objects.
*
* Length field has value 0x80, and the sequence ends with two bytes of: 0x00, 0x00.
*
* For X.690 syntax rules, see {@link ASN1Sequence}.
*
*/
public class BERSequence
extends ASN1Sequence
{
/**
* Create an empty sequence
*/
public BERSequence()
{
}
/**
* Create a sequence containing one object
*/
public BERSequence(ASN1Encodable element)
{
super(element);
}
/**
* Create a sequence containing a vector of objects.
*/
public BERSequence(ASN1EncodableVector elementVector)
{
super(elementVector);
}
/**
* Create a sequence containing an array of objects.
*/
public BERSequence(ASN1Encodable[] elements)
{
super(elements);
}
int encodedLength() throws IOException
{
int count = elements.length;
int totalLength = 0;
for (int i = 0; i < count; ++i)
{
ASN1Primitive p = elements[i].toASN1Primitive();
totalLength += p.encodedLength();
}
return 2 + totalLength + 2;
}
void encode(ASN1OutputStream out, boolean withTag) throws IOException
{
out.writeEncodedIndef(withTag, BERTags.SEQUENCE | BERTags.CONSTRUCTED, elements);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy