Partager via


CertificateFactorySpi.EngineGenerateCertificates(Stream) Method

Definition

Returns a (possibly empty) collection view of the certificates read from the given input stream inStream.

[Android.Runtime.Register("engineGenerateCertificates", "(Ljava/io/InputStream;)Ljava/util/Collection;", "GetEngineGenerateCertificates_Ljava_io_InputStream_Handler")]
public abstract System.Collections.Generic.ICollection<Java.Security.Cert.Certificate>? EngineGenerateCertificates (System.IO.Stream? inStream);
[<Android.Runtime.Register("engineGenerateCertificates", "(Ljava/io/InputStream;)Ljava/util/Collection;", "GetEngineGenerateCertificates_Ljava_io_InputStream_Handler")>]
abstract member EngineGenerateCertificates : System.IO.Stream -> System.Collections.Generic.ICollection<Java.Security.Cert.Certificate>

Parameters

inStream
Stream

the input stream with the certificates.

Returns

a (possibly empty) collection view of java.security.cert.Certificate objects initialized with the data from the input stream.

Attributes

Exceptions

if parsing problems are detected.

Remarks

Returns a (possibly empty) collection view of the certificates read from the given input stream inStream.

In order to take advantage of the specialized certificate format supported by this certificate factory, each element in the returned collection view can be typecast to the corresponding certificate class. For example, if this certificate factory implements X.509 certificates, the elements in the returned collection can be typecast to the X509Certificate class.

In the case of a certificate factory for X.509 certificates, inStream may contain a single DER-encoded certificate in the formats described for CertificateFactory#generateCertificate(java.io.InputStream) generateCertificate. In addition, inStream may contain a PKCS#7 certificate chain. This is a PKCS#7 SignedData object, with the only significant field being certificates. In particular, the signature and the contents are ignored. This format allows multiple certificates to be downloaded at once. If no certificates are present, an empty collection is returned.

Note that if the given input stream does not support java.io.InputStream#mark(int) mark and java.io.InputStream#reset() reset, this method will consume the entire input stream.

Java documentation for java.security.cert.CertificateFactorySpi.engineGenerateCertificates(java.io.InputStream).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to