diff options
Diffstat (limited to 'vespa-athenz/src/main/java/com/yahoo/vespa/athenz/client/zts/InstanceIdentity.java')
-rw-r--r-- | vespa-athenz/src/main/java/com/yahoo/vespa/athenz/client/zts/InstanceIdentity.java | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/client/zts/InstanceIdentity.java b/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/client/zts/InstanceIdentity.java new file mode 100644 index 00000000000..34548351b23 --- /dev/null +++ b/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/client/zts/InstanceIdentity.java @@ -0,0 +1,34 @@ +// Copyright 2018 Yahoo Holdings. 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); + } +} |