Welcome to mirror list, hosted at ThFree Co, Russian Federation.

VPKCRequestData.java « dvcs « bouncycastle « org « java « main « src « pkix - gitlab.com/quite/humla-spongycastle.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9624ef7f06bdeda13c6aff578d82e5bd2a8021b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package org.bouncycastle.dvcs;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.bouncycastle.asn1.dvcs.Data;
import org.bouncycastle.asn1.dvcs.TargetEtcChain;

/**
 * Data piece of DVCS request to VPKC service (Verify Public Key Certificates).
 * It contains VPKC-specific interface.
 * <p/>
 * This objects are constructed internally,
 * to build DVCS request to VPKC service use VPKCRequestBuilder.
 */
public class VPKCRequestData
    extends DVCSRequestData
{
    private List chains;

    VPKCRequestData(Data data)
        throws DVCSConstructionException
    {
        super(data);

        TargetEtcChain[] certs = data.getCerts();

        if (certs == null)
        {
            throw new DVCSConstructionException("DVCSRequest.data.certs should be specified for VPKC service");
        }

        chains = new ArrayList(certs.length);

        for (int i = 0; i != certs.length; i++)
        {
            chains.add(new TargetChain(certs[i]));
        }
    }

    /**
     * Get contained certs choice data..
     *
     * @return a list of CertChain objects.
     */
    public List getCerts()
    {
        return Collections.unmodifiableList(chains);
    }
}