Package org.pgpainless.key.collection

# Class PGPKeyRingCollection

java.lang.Object
org.pgpainless.key.collection.PGPKeyRingCollection

public class PGPKeyRingCollection extends Object
This class describes a logic of handling a collection of different `PGPKeyRing`. The logic was inspired by `PGPSecretKeyRingCollection` and `PGPPublicKeyRingCollection`.

## Constructor Summary

Constructors
Constructor
Description
`PGPKeyRingCollection(byte[] encoding, boolean isSilent)`
`PGPKeyRingCollection(InputStream in, boolean isSilent)`
Build a `PGPKeyRingCollection` from the passed in input stream.
`PGPKeyRingCollection(Collection<org.bouncycastle.openpgp.PGPKeyRing> collection, boolean isSilent)`

## Method Summary

Modifier and Type
Method
Description
`org.bouncycastle.openpgp.PGPPublicKeyRingCollection`
`getPgpPublicKeyRingCollection()`
`org.bouncycastle.openpgp.PGPSecretKeyRingCollection`
`getPGPSecretKeyRingCollection()`
`int`
`size()`
Return the number of rings in this collection.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### PGPKeyRingCollection

public PGPKeyRingCollection(@Nonnull byte[] encoding, boolean isSilent) throws IOException, org.bouncycastle.openpgp.PGPException

Throws:
  `IOException`
  `org.bouncycastle.openpgp.PGPException`

### PGPKeyRingCollection

public PGPKeyRingCollection(@Nonnull InputStream in, boolean isSilent) throws IOException, org.bouncycastle.openpgp.PGPException
Build a `PGPKeyRingCollection` from the passed in input stream.

Parameters:
  `in` - input stream containing data
  `isSilent` - flag indicating that unsupported objects will be ignored
Throws:
  `IOException` - if a problem parsing the base stream occurs
  `org.bouncycastle.openpgp.PGPException` - if an object is encountered which isn't a `PGPSecretKeyRing` or `PGPPublicKeyRing`

### PGPKeyRingCollection

public PGPKeyRingCollection(@Nonnull Collection<org.bouncycastle.openpgp.PGPKeyRing> collection, boolean isSilent) throws org.bouncycastle.openpgp.PGPException

Throws:
  `org.bouncycastle.openpgp.PGPException`

## Method Details

### getPGPSecretKeyRingCollection

@Nonnull public org.bouncycastle.openpgp.PGPSecretKeyRingCollection getPGPSecretKeyRingCollection()

### getPgpPublicKeyRingCollection

@Nonnull public org.bouncycastle.openpgp.PGPPublicKeyRingCollection getPgpPublicKeyRingCollection()

### size

public int size()
Return the number of rings in this collection.

Returns:
  total size of `PGPSecretKeyRingCollection` and `PGPPublicKeyRingCollection` in this collection