aboutsummaryrefslogtreecommitdiffstats
path: root/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/client/zts/InstanceIdentity.java
blob: 1d7cc09e4cce1a3b76612c6ca96862cbe6c4f270 (plain) (blame)
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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.athenz.client.zts;

import com.yahoo.vespa.athenz.api.NToken;

import java.security.cert.X509Certificate;
import java.util.Optional;

/**
 * The identity of an instance of a launched service.
 *
 * @author bjorncs
 */
public class InstanceIdentity {
    private final X509Certificate certificate;
    private final NToken nToken;

    public InstanceIdentity(X509Certificate certificate) {
        this(certificate, null);
    }

    public InstanceIdentity(X509Certificate certificate, NToken nToken) {
        this.certificate = certificate;
        this.nToken = nToken;
    }

    public X509Certificate certificate() {
        return certificate;
    }

    public Optional<NToken> nToken() {
        return Optional.ofNullable(nToken);
    }
}