| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.security.net.config; |
| 18 |
|
| 19 |
import android.util.ArraySet; |
| 20 |
import java.util.Collections; |
| 21 |
import java.util.Set; |
| 22 |
|
| 23 |
|
| 24 |
public final class PinSet { |
| 25 |
public static final PinSet EMPTY_PINSET = |
| 26 |
new PinSet(Collections.<Pin>emptySet(), Long.MAX_VALUE); |
| 27 |
public final long expirationTime; |
| 28 |
public final Set<Pin> pins; |
| 29 |
|
| 30 |
public PinSet(Set<Pin> pins, long expirationTime) { |
| 31 |
if (pins == null) { |
| 32 |
throw new NullPointerException("pins must not be null"); |
| 33 |
} |
| 34 |
this.pins = pins; |
| 35 |
this.expirationTime = expirationTime; |
| 36 |
} |
| 37 |
|
| 38 |
Set<String> getPinAlgorithms() { |
| 39 |
|
| 40 |
Set<String> algorithms = new ArraySet<String>(); |
| 41 |
for (Pin pin : pins) { |
| 42 |
algorithms.add(pin.digestAlgorithm); |
| 43 |
} |
| 44 |
return algorithms; |
| 45 |
} |
| 46 |
} |