package org.jivesoftware.smackx.ikey.record;

import org.jivesoftware.smackx.ox.element.OpenPgpElement;
import org.pgpainless.key.OpenPgpV4Fingerprint;

import java.net.URI;
import java.util.UUID;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

@EqualsAndHashCode
public class OxSubordinateRecord implements IkeySubordinateRecord {

    public static final String TYPE = OpenPgpElement.NAMESPACE;

    @Getter
    @Setter
    private UUID id;

    public OxSubordinateRecord() {
        this.id = UUID.randomUUID();
    }

    public OxSubordinateRecord(UUID id, OpenPgpV4Fingerprint fingerprint, URI uri) {
        this.id = id;
        this.oxFingerprint = fingerprint;
        this.uri = uri;
    }

    @Getter
    @Setter
    private OpenPgpV4Fingerprint oxFingerprint;

    @Getter
    @Setter
    private URI uri;

    @Override
    public String getType() {
        return TYPE;
    }

    @Override
    public String getFingerprint() {
        return oxFingerprint.toString();
    }
}
